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

Log onto Authenticated Website 1

Status
Not open for further replies.

mveilleu

Programmer
Jul 23, 2004
13
US
I need to log onto an authenticated website through VBScript so I may have the script download a few files. This log on is not through a regular HTML form, it is through a message box log on screen. I'm currently using the navigate function to get to the page, is there any way to automatically fill in the user information and "press enter"

Thank you
 
You may consider the SendKeys method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I have tried, but can't seem to get that working. Here is what I have for sample code.

set objExplorer = CreateObject "InternetExplorer.Application")

objExplorer.Navigate "path to site"

objExplorer.Visible = true
objExplorer.SendKeys "d{ENTER}" <--------- this won't work

let me know if you have any ideas. Thank you so much.
 
I think this may be because the focus is not on the Internet Explorer window. Is there any way I can change focus to that window?

Thanks again.
 
can you send the link to the page? There are many ways to do this depending on the page/

 
Yes I can get the page to come up with the correct link. But then the log in screen prompts for a username and password. This is where I am getting stuck.

Thank you.
 
I was wondering if you could send me the page. You might be able to tell the URl what the user name and password is. You might be able to post informaton to the actions in the form or you might have to send keys to the page. If you can send me the link I will take a look at the page. Is this a public page?


Timgerr.
 
This is not a public page, but here is one that acts very similar. This is not an HTML form therefore you cannot post to any action scripts. Sendkey's seems to be the only way but can't get it to work.


Thank you.
 
SendKeys is a method of the WScript.Shell object, not of InternetExplorer.Application, AFAIK.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Give this a try

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 "Username"
objShell.SendKeys "{tab}"
wscript.sleep 1000
objShell.SendKeys "Password"
objShell.SendKeys "{enter}"

Timgerr
 
Sorry run it from the command line with cscript
c:\> cscript filename.vbs
 
Well this doesn't work for me.
when I run it from the commande line: c:\> cscript filename.vbs the focus is not on the user/pass popup window.
If I execute the script and one the popup appears I click on it then I can see the use and password been pass the the popup. But I have to click on it...

Anyone have any other way to do that???

 
Ok I finnally figured it out.
You don't need to sendkey everything, anyway it worked for me:
objShell.SendKeys "Username"
objShell.SendKeys "Password"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top