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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Gaining Control of Webpage

Status
Not open for further replies.

mtepfer

IS-IT--Management
Apr 21, 2003
55
US
Am writing my first script and want to be able to login to a website using my login and password. Have found lot's of useful items through here but can't get the login id and password to get entered. It appears that the focus is not being set on the website. It will open the webpage but keeps it minimized in the taskbar.

I am running vista and use the grouping function for similiar items.

I have noticed that if I save the script to the desktop and run it from there it will open on the screen but still no focus on the website.

If I open the website manually it will come up with the cursor already in the login name box.

Any ideas are greatly appreciated.

Here is the code:

Set objShell = CreateObject("WScript.Shell")

Set objExplorer = WScript.CreateObject _
("InternetExplorer.Application", "IE_")
objExplorer.Navigate "objExplorer.ToolBar = 0

objExplorer.StatusBar = 0
objExplorer.Width = 1000
objExplorer.Height = 500
objExplorer.Left = 0
objExplorer.Top = 0
objExplorer.Visible = 1


WScript.sleep 3000
objShell.SendKeys "login"
objShell.SendKeys "{tab}"
wscript.sleep 1000
objShell.SendKeys "password"
objShell.SendKeys "{enter}"
 
Look at the page source and see if the fields have unique names or id's and that way you can enter your information directly instead of using SendKeys.

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Unfortuanetly I don't see tht it does, I have tried passing the name and password through the address but no luck with that either. When I view the source of the page this is all I get :

<html>
<head>
<title>McCright & Associates Inspection Database</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript">
<!--
//-->
</script>
</head>
<noscript>
<body>
<p>This site requires a JavaScript-capable browser.<br/>
If you have JavaScript turned off, please turn it on and reload this page.</p>
</body>
</noscript>
<noframes>
<body>
<p>This site requires a frames-capable browser.</p>
</body>
</noframes>

<frameset framespacing="0" border="true" frameborder="0" rows="17%,*,0">
<frame name="nav" scrolling="auto" marginwidth="0" marginheight="0" src="nav.html" />
<frame name="display" scrolling="auto" marginwidth="0" marginheight="0" src="welcome.html" />
<frame name="work" src="empty.html" />
</frameset>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top