G
geebee
hi,
I have the following. Trying to adapt/change it to work if i already have
the Internet explorer instance open, instead of creating a new IE window:
Private Sub Command1_Click()
Dim o2
Set o2 = CreateObject("internetexplorer.application")
o2.navigate "http://www.aol.com "
o2.Visible = True
While o2.busy: DoEvents: Wend
Set o = o2.Document.All.tags("A")
M = o.Length: mySubmit = -1
For r = 0 To M - 1: zz = ""
zz = zz & "Link Index : " & r & " of " & o.Length - 1
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . tabindex : " & o.Item(r).TabIndex
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . tagname : " & o.Item(r).tagname
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . href : " & o.Item(r).href
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . type : " & o.Item(r).Type
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . name : " & o.Item(r).Name
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . innerhtml : " & o.Item(r).innerhtml
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . outerhtml : " & o.Item(r).outerhtml
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . rel : " & o.Item(r).rel
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . rev : " & o.Item(r).rev
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . id : " & o.Item(r).ID
zz = zz & String(3, vbCrLf)
'MsgBox zz
If InStr(1, o.Item(r).innerhtml, "Food", vbTextCompare) Then
'MsgBox "= F O U N D =" & vbCrLf & o.Item(r).innerhtml
o.Item(r).Click: Exit For
End If
Next
' o2.Quit
' Set o2 = Nothing
End Sub
Please note that i already have an IE window open as created by the
folllowing:
Dim myIE As New InternetExplorer 'New '
Dim myURL As String
Dim myURL33 As String
Dim myDoc As HTMLDocument
Dim strSearch As String
'Set starting URL and search string
myURL = "https://site.com/something/Logon.asp"
strSearch = "user"
'Make IE navigate to the URL and make browser visible
myIE.navigate myURL
myIE.Visible = True
thanks in advance,
geebee
I have the following. Trying to adapt/change it to work if i already have
the Internet explorer instance open, instead of creating a new IE window:
Private Sub Command1_Click()
Dim o2
Set o2 = CreateObject("internetexplorer.application")
o2.navigate "http://www.aol.com "
o2.Visible = True
While o2.busy: DoEvents: Wend
Set o = o2.Document.All.tags("A")
M = o.Length: mySubmit = -1
For r = 0 To M - 1: zz = ""
zz = zz & "Link Index : " & r & " of " & o.Length - 1
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . tabindex : " & o.Item(r).TabIndex
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . tagname : " & o.Item(r).tagname
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . href : " & o.Item(r).href
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . type : " & o.Item(r).Type
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . name : " & o.Item(r).Name
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . innerhtml : " & o.Item(r).innerhtml
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . outerhtml : " & o.Item(r).outerhtml
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . rel : " & o.Item(r).rel
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . rev : " & o.Item(r).rev
zz = zz & String(3, vbCrLf)
'
zz = zz & "A . id : " & o.Item(r).ID
zz = zz & String(3, vbCrLf)
'MsgBox zz
If InStr(1, o.Item(r).innerhtml, "Food", vbTextCompare) Then
'MsgBox "= F O U N D =" & vbCrLf & o.Item(r).innerhtml
o.Item(r).Click: Exit For
End If
Next
' o2.Quit
' Set o2 = Nothing
End Sub
Please note that i already have an IE window open as created by the
folllowing:
Dim myIE As New InternetExplorer 'New '
Dim myURL As String
Dim myURL33 As String
Dim myDoc As HTMLDocument
Dim strSearch As String
'Set starting URL and search string
myURL = "https://site.com/something/Logon.asp"
strSearch = "user"
'Make IE navigate to the URL and make browser visible
myIE.navigate myURL
myIE.Visible = True
thanks in advance,
geebee