Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB script to launch url from inside a webpage

Status
Not open for further replies.

lvjan777

Programmer
Oct 10, 2007
1
US
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>&nbsp;&nbsp;
<a class=iLinks href="elsHelp.asp?TOPIC=surflist" target="_blank">
Help</a>&nbsp;&nbsp;
<a class=iLinks href="elsLoginReset.asp">LogOut</a>&nbsp;&nbsp;
<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:&nbsp;</b></font></td>
<td align=center>
<font class=iText><b>&nbsp;23000&nbsp;
</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>
 
Good grief you actually posted the credentials for your account. You need to change that password right away. Remember to scrub your code before you post it.



RoadKi11

"This apparent fear reaction is typical, rather than try to solve technical problems technically, policy solutions are often chosen." - Fred Cohen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top