Hi I am new to VBA and I am trying to automatically login into a webpage using VBA and I was successful for few websites but for this particular webpage I am unable to do it
Below is my VBA code :
Sub login ()
Set IE = CreateObject("InternetExplorer.application")
IE.AddressBar = 0
IE.StatusBar = 0
IE.Toolbar = 0
IE.Visible = True
IE.navigate "www.sample.com"
Do Until Not IE.busy: DoEvents: Loop
Set doc = IE.document
Do While doc.ReadyState <> "complete": DoEvents: Loop
IE.document.all("ocsid").Value = "xx"
IE.document.all("password").Value = "yy"
IE.document.all("Submit").Click
End Sub
Here is the HTML code of the login area which i copied from the web page
</TR>
<TR>
<TD width="165"><FONT FACE="Arial, Helvetica" SIZE=2><b>OCS Id:</b></FONT></TD>
<TD align="center" width="95"><INPUT size="15" type="text" maxlength="10" name="ocsid"></TD>
</TR>
<TR>
<TD width="165"><FONT FACE="Arial, Helvetica" SIZE=2><b>OCS Password</b></FONT>:</TD>
<TD align="center" width="95"><INPUT size="15" type="password" maxlength="8" name="password"></TD>
</TR>
<TR>
<TD width="165"><FONT FACE="Arial, Helvetica" SIZE=2><b>X500 Id:</b></FONT></TD>
<TD align="center" width="95"><INPUT size="15" type="text" maxlength="10" name="x500id"></TD>
</TR>
<TR>
<TD height="15" width="165"></TD>
<TD width="95"></TD>
</TR>
<TR>
<TD align="center" width="165" colspan="2"><INPUT type="checkbox" name="changePasswordBox" onclick="changePassword2();" />
<FONT FACE="Arial, Helvetica" SIZE=2><b>Change Password</b></FONT></TD>
</TR>
</TABLE>
<div id="HideArea" >
<TABLE width="287">
<TR>
<TD width="165"><FONT FACE="Arial, Helvetica" SIZE=2><b>New Password:</b></FONT></TD>
<TD align="center" width="95"><INPUT size="15" type="password" maxlength="8" name="newpassword"></TD>
</TR>
<TR>
<TD width="165"><FONT FACE="Arial, Helvetica" SIZE=2><b>Verify New Password:</b></FONT></TD>
<TD align="center" width="95"><INPUT size="15" type="password" maxlength="8" name="VERIFY_NEW_PWD" ></TD>
</TR>
<TR>
</TABLE>
</div>
<TABLE width="287">
<TR>
<TD height="15" width="165"></TD>
<TD width="95"></TD>
</TR>
<TR>
<TD colspan="2" align="center"><input type="submit" name="Submit" value="Submit" onclick="if (top.frames[0] && top.frames[0].animate) top.frames[0].animate.start();" style="width: 60px">
<INPUT style="width: 60px" type="button" name="Reset" value="Reset" onClick="resetPage();"></TD>
</TR>
I hope this will help you to answer my question !!
Comments :- I am so sorry !! I do not understand what you are asking for ? But i just found out something, when i do a right click on the page using chrome it gives an extra option as "View Frame Source", normally all other website which i successfully automated the above process will have only one option as "View page source" using which i will find the "ID" and "Tags" and so on .... And when i click the "View page source" option I do not see any "ID" and "Tags" instead I have only links which end with .jsp format and when i click the link it takes me to the part of the webpage (like login area) (Legal Notice and Privacy Policy).... I am not sure whether this will help you or not !! But i am truly sorry and I Thank you a lot, for your work !!!!