jamescooper
Well-known Member
- Joined
- Sep 8, 2014
- Messages
- 840
The following code is only pulling 1 result when there should be 6 results, can anyone spot where the code is overwriting rather than adding to it?
Many thanks.
Many thanks.
Code:
Sub Meeting_List()
Dim IE As InternetExplorer
Set IE = New InternetExplorer
Dim ElementCol As Object
Dim Link As Object
Dim erow As Long
With IE
.navigate Sheet2.Range("A1")
.Visible = True
Do While IE.readyState <> READYSTATE_COMPLETE
DoEvents
Loop
Application.Wait Now + TimeValue("00:00:03")
End With
Dim html As HTMLDocument
Set html = IE.Document
Dim ele As IHTMLElementCollection
Dim lists As IHTMLElementCollection
Dim row As Long
Set ele = html.getElementsByTagName("a")
For Each e In ele
If e.className = "gh dogName" Then
Set lists = e.getElementsByTagName("strong")
row = 1
For Each strong In lists
Cells(row, 1) = strong.innerText
row = row + 1
Next
End If
Next e
IE.Quit
End Sub