vbscript - Website login: unspecified error when using getElementById -


i have vbscript, want use automatically logon website , download files on daily basis. following script returning

unspecified error" (code 80004005)

at line containing:

set elid = ie.document.getelementbyid("ctl00_maincontent_logincontrol_wizardlogin_usernamelogin") 

can please advise possible reasons causing "unspecified error" on line stated above? assistance appreciated.

the entered login numeric digits should appended value 4519008, present in login dialogue box, when website screen displayed.

after login number has been appended 4519008 , password aded, should click on sign in button, next stage of login process.

how simulate clicking in login screen after text 4159008?

i sure entered element id correct in vbscript (html snippet shown below).

when above screen logged in manually, 1 has click after 4519008 number , enter additional numerical digits. cursor not automatically show after 4519008 number.

whole vbscript follows:

dim ie  set ie = createobject("internetexplorer.application") set ws= wscript.createobject("wscript.shell")  ie.visible = 1 ie.navigate "https://<website url>"  while (ie.busy)     wscript.sleep 200 loop  set elid = ie.document.getelementbyid("ctl00_maincontent_logincontrol_wizardlogin_usernamelogin") elid.value = <numerical digits>  set elid = ie.document.getelementbyid("ctl00_maincontent_logincontrol_wizardlogin_password") elid .value = <alpha numeric password>  set elid = ie.document.getelementbyid("ctl00_maincontent_logincontrol_loginbutton")  ie.document.forms(0).submit() 

the syntax looks correct! id parameter looks correct , obtained website source, snippet follows:

<div class="logincontrol">     <table cellspacing="0" cellpadding="0" id="ctl00_maincontent_logincontrol_wizardlogin" style="border-collapse:collapse;">         <tr style="height:100%;">             <td>                 <div class="loginbox">                     <div class="loginheader">&nbsp;&nbsp;enter login id , password</div>                     <div class="plaintextbox">                         <span id="ctl00_maincontent_logincontrol_wizardlogin_lblsrf">4519008#########</span>                     </div>                     <div class="loginrow">                         <div class="loginlabel">                             <label for="ctl00_maincontent_logincontrol_wizardlogin_usernamelogin" id="ctl00_maincontent_logincontrol_wizardlogin_usernamelabellogin">&nbsp;&nbsp;login:</label>                         </div>                         <div class="logininput">                             <input name="ctl00$maincontent$logincontrol$wizardlogin$usernamelogin" type="text" value="4519008" id="ctl00_maincontent_logincontrol_wizardlogin_usernamelogin" tabindex="10" autocomplete="off" />                         </div>                     </div>                     <div class="loginrow">                         <div class="loginlabel">                             <label for="ctl00_maincontent_logincontrol_wizardlogin_password" id="ctl00_maincontent_logincontrol_wizardlogin_passwordlabel">&nbsp;&nbsp;password:</label>                         </div>                         <div class="logininput">                             <input name="ctl00$maincontent$logincontrol$wizardlogin$password" type="password" id="ctl00_maincontent_logincontrol_wizardlogin_password" tabindex="20" autocomplete="off" />                         </div>                     </div>                     <div class="linkforgot">                         <a id="ctl00_maincontent_logincontrol_wizardlogin_linkbuttonforgot" tabindex="30" href="javascript:webform_dopostbackwithoptions(new webform_postbackoptions(&quot;ctl00$maincontent$logincontrol$wizardlogin$linkbuttonforgot&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, true))">having problems logging in?</a>                     </div>                 </div>             </td>         </tr>         <tr>             <td align="right"></td>         </tr> 


Comments