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

WebQuery for web php sites that require a log in 2

Status
Not open for further replies.

nfpinero

Programmer
Dec 2, 2007
3
ES
Hi All,

I want to enter in this web for store the page into a workbook. but this web require a log in to enter in the page,

I read the article faq707-6400 of the FAQ but does not work for me. I modified the code and I have adapted to my needs but does not work, What can I do?

Many thanks.

Norberto
 
The following code should work if the link directs you to the login page. Although, the link doesn't always go to the login page...
Code:
Sub Web_Login()
   Dim objIE As Object, user_name As String, pass_word As String
   
   user_name = InputBox("Enter User Name")
   pass_word = InputBox("Enter Password")
   
   Set objIE = CreateObject("InternetExplorer.Application")
   
   With objIE
      .Visible = True
      .Navigate "[URL unfurl="true"]http://62.108.227.100/quotazioni/pagnit.php"[/URL]
   End With
   
   Call Browser_Wait(objIE)
   
   On Error Resume Next
   
   objIE.Document.Forms("loginCheck").all.item("username").Value = user_name
   objIE.Document.Forms("loginCheck").all.item("password").Value = pass_word
   objIE.Document.Forms("loginCheck").submit
   
   Call Browser_Wait(objIE)
End Sub

Private Sub Browser_Wait(objIE As Object)
   While objIE.Busy
      DoEvents
   Wend
   
   While objIE.Document.ReadyState <> "complete"
      DoEvents
   Wend
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top