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

how to bypass a secured web page and automatically click on a button?

Status
Not open for further replies.

tmai2

Programmer
Jan 30, 2007
2
US
Hi,

I need some help to write a vbscript to open a secured web page and automatcially click on a button. Any help is greatly appreciated.

Thanks,

TM
 
Do you have access tot he page code? You will need to knwo where it submits to and what string it sends. You can then send that to the next page as part of a connection string.

or if you know the object name you can call it by making an IEObject.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Thanks for response Mark. Here is the code I wrote but I don't know how to bypass the security alert if using IE object, I can bypass by using MSXML2.ServerXMLHTTP object but don't know how to parse for a button and auto-click it.


Dim oIE, webPage
Dim strURL

strURL = " IP address>/hp/device/this.LCDispatcher?nav=hp.DateAndTime"

'Dim objHTTP
'Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP")
'objHTTP.SetOption 2, 13056 'Ignore all SSL errors
'objHTTP.Open "GET", strURL, False
'objHTTP.Send
'Set objHTTP = Nothing

Set oIE = CreateObject("InternetExplorer.Application")

oIE.Visible = True
oIE.Navigate(strURL)

' loop until the page is loaded
While oIE.Busy
Wend
oIE.Document.All.Item("btnNTSSettings").Click
' loop until the page is loaded
While oIE.Busy
Wend
oIE.Document.All.Item("btnSyncNow").Click
While oIE.Busy
Wend
oIE.Quit
Set oIE = Nothing
 
What does the code for the target look like? Can you post a screen shot of the security message you are getting?

More than likely you only need to add the web page to your trusted sites.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top