shahin
Active Member
Can't figure out how can I get all the company links from the page used in my code. Running my script I get only 20 links. The page has got lazyloading method that is why I can't get all of them. Any input on this will be highly appreciated. I've tried so far with:
Code:
Sub Web_Data()
Const lnk = "http://fortune.com"
Dim http As New XMLHTTP60, html As New HTMLDocument
Dim topics As Object, topic As Object
With http
.Open "GET", "http://fortune.com/fortune500/list/", False
.send
html.body.innerHTML = .responseText
End With
For Each topic In html.getElementsByClassName("small-12 column row")
x = x + 1
With topic.getElementsByTagName("a")
If .Length Then Cells(x, 1) = lnk & Split(.item(0).href, "about:")(1)
End With
Next topic
Set html = Nothing: Set topics = Nothing
End Sub