View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default how to find username/passowrd controls

It is a usually userform. I look at the source html usiing by going to the
internet explorer and using the menu view - source. the internet explorer 8
under tools - developer tools you can see the tag items.

You need to either find the Tag associated with the login or the "id=". If
you give me the webpage URL I will get you the username and login code.

the code below is similar to a login window and will give yo a good idea how
this is accomplished

Sub GetZipCodes()


ZIPCODE = InputBox("Enter 5 digit zipcode : ")

Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True

URL = "http://zip4.usps.com/zip4/citytown_zip.jsp"

'get web page
IE.Navigate2 URL
Do While IE.readyState < 4 And _
IE.busy = True

DoEvents
Loop

Set Form = IE.document.getElementsByTagname("Form")

Set zip5 = IE.document.getElementById("zip5")
zip5.Value = ZIPCODE


Set ZipCodebutton = Form(0).onsubmit

Form(0).submit
Do While IE.busy = True
DoEvents
Loop

Set Table = IE.document.getElementsByTagname("Table")
Location = Table(0).Rows(2).innertext
IE.Quit
MsgBox ("Zip code = " & ZIPCODE & " City/State = " & Location)


End Sub



"thomas donino" wrote:

I need to navigate to a webpage, and login with user and pass.
How do I know what the webpage is looking for for the username, meaning
user, or username or accountname etc etc
my current code using
variablename.value = "user" is where the code is barfing