I want to login to a website and navigate to pages that are links. I can't figure out how to activate the link in code. I'm new to vb script. This code is working:
Set IE = CreateObject("InternetExplorer.Application")
set WshShell = WScript.CreateObject("WScript.Shell")
IE.Navigate "IE.Visible = True
Wscript.Sleep 6000
IE.Document.All.Item("fldUserName").Value = "freezonebea@yahoo.com"
IE.Document.All.Item("fldPassword").Value = "lasvegas"
IE.Document.All.Item("cmdSubmit").Click
wscript.sleep 1000
IE.Navigate "
When I get to this page, there is another url that I want to activate. I tried the IE.Navigate command pointing to the new url but I get an "invalid action" error. I want to activate Once I get the webpage open, I want to close it and return to the page.
Here is the source code for the website down to where the url is. If you run the vbscript above you'll be able to see what I'm trying to do.
Thanks in advance for your help.
<html>
<head>
<title>KSNE-FM</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK REL="StyleSheet" HREF="../stylesheets/allpages.css" TYPE="text/css" media=screen>
</head>
<body class="gBody" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<center>
<table cellspacing="0" cellpadding="6" border="0" width=450>
<tr>
<td valign="top"><font class="iText"><table border=0 cellpadding=1 cellspacing=0 width="100%">
<tr><td valign=top align=center>
<a class=iLinks href="elsMainMenu.asp">Menu</a>
<a class=iLinks href="elsHelp.asp?TOPIC=surflist" target="_blank">
Help</a>
<a class=iLinks href="elsLoginReset.asp">LogOut</a>
<a class=iLinks href="elsSignupFrm.asp?ALL=YES">Change Contact Info</a>
<br>
<font class=iHeadline><b>Sunny Websites - Visit for Points</b></font><br>
<font class=iText>Beatrice Itah</font><br>
</td></tr>
<tr><td align=center>
<table border=0 cellspacing=0 cellpadding=1>
<tr><td><font class=iText><b>Your Points Total: </b></font></td>
<td align=center>
<font class=iText><b> 23000
</td></tr></table>
</td></tr>
</table>
<IMG src=" border=0><BR>
<STRONG><BIG>Make sure to allow pop-ups from this site to earn points!</BIG></STRONG>
<br><p>
<table width="100%" class=elsTable cellspacing=0 cellpadding=6>
<tr>
<td class=elsCellField>
<a class=elsCellField href="elsSurfWebPrc.asp?UID=6749">
<b>
Dana Tyson's personality page
</b></a>
</td>
</tr>
<tr>
<td class=elsCellData>
<table border=0 width="100%" cellspacing=0 cellpadding=2><tr>
<td align=left>
<img src=" border=0><br>
</td>
<td align=left>
<font class=iText>Get to know Dana Tyson by surfing her personality page. Plus you will earn 100 points!!!</font>
</td>
</tr></table>
<br>
<b>
100 Points for visiting
</b>
</td>
</tr>
</table>
</p>
<p>
Set IE = CreateObject("InternetExplorer.Application")
set WshShell = WScript.CreateObject("WScript.Shell")
IE.Navigate "IE.Visible = True
Wscript.Sleep 6000
IE.Document.All.Item("fldUserName").Value = "freezonebea@yahoo.com"
IE.Document.All.Item("fldPassword").Value = "lasvegas"
IE.Document.All.Item("cmdSubmit").Click
wscript.sleep 1000
IE.Navigate "
When I get to this page, there is another url that I want to activate. I tried the IE.Navigate command pointing to the new url but I get an "invalid action" error. I want to activate Once I get the webpage open, I want to close it and return to the page.
Here is the source code for the website down to where the url is. If you run the vbscript above you'll be able to see what I'm trying to do.
Thanks in advance for your help.
<html>
<head>
<title>KSNE-FM</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK REL="StyleSheet" HREF="../stylesheets/allpages.css" TYPE="text/css" media=screen>
</head>
<body class="gBody" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<center>
<table cellspacing="0" cellpadding="6" border="0" width=450>
<tr>
<td valign="top"><font class="iText"><table border=0 cellpadding=1 cellspacing=0 width="100%">
<tr><td valign=top align=center>
<a class=iLinks href="elsMainMenu.asp">Menu</a>
<a class=iLinks href="elsHelp.asp?TOPIC=surflist" target="_blank">
Help</a>
<a class=iLinks href="elsLoginReset.asp">LogOut</a>
<a class=iLinks href="elsSignupFrm.asp?ALL=YES">Change Contact Info</a>
<br>
<font class=iHeadline><b>Sunny Websites - Visit for Points</b></font><br>
<font class=iText>Beatrice Itah</font><br>
</td></tr>
<tr><td align=center>
<table border=0 cellspacing=0 cellpadding=1>
<tr><td><font class=iText><b>Your Points Total: </b></font></td>
<td align=center>
<font class=iText><b> 23000
</td></tr></table>
</td></tr>
</table>
<IMG src=" border=0><BR>
<STRONG><BIG>Make sure to allow pop-ups from this site to earn points!</BIG></STRONG>
<br><p>
<table width="100%" class=elsTable cellspacing=0 cellpadding=6>
<tr>
<td class=elsCellField>
<a class=elsCellField href="elsSurfWebPrc.asp?UID=6749">
<b>
Dana Tyson's personality page
</b></a>
</td>
</tr>
<tr>
<td class=elsCellData>
<table border=0 width="100%" cellspacing=0 cellpadding=2><tr>
<td align=left>
<img src=" border=0><br>
</td>
<td align=left>
<font class=iText>Get to know Dana Tyson by surfing her personality page. Plus you will earn 100 points!!!</font>
</td>
</tr></table>
<br>
<b>
100 Points for visiting
</b>
</td>
</tr>
</table>
</p>
<p>