Update VBA scraping code
Budget: $30 – $250 AUD
Need to update the following code as lunarcrush has updated their website.
I need to capture:
the coin code eg. BTC
the Social Volume
the Social Engagment
the Social Dominance
//EXITING CODE
Sub lunarcrush()
Application.ScreenUpdating = False
Dim d As WebDriver
Set d = New ChromeDriver
With d
.AddArgument "--headless"
.Start "Chrome"
End With
For i = 0 To 3
With d
DoEvents
.Get "https://lunarcrush.com/markets?metric=social_volume&filter=&rpp=300&page=&col=1&reverse=" & i
While d.ExecuteScript("return document.readyState") <> "complete": Wend
End With
Application.Wait Now() + TimeValue("0:0:07")
Set a = d.FindElementsByCss(".r-1b43r93")
For Each aa In a
On Error Resume Next
rw = Sheets("Workings").Range("A1048576").End(xlUp).Row + 1
Sheets("Workings").Cells(rw, "A") = aa.Attribute("data-row") & "USDT"
Sheets("Workings").Cells(rw, "B") = aa.FindElementsByTag("td")(4).Text
Sheets("Workings").Cells(rw, "C") = aa.FindElementsByTag("td")(5).Text
Next
Next i
I need to capture:
the coin code eg. BTC
the Social Volume
the Social Engagment
the Social Dominance
//EXITING CODE
Sub lunarcrush()
Application.ScreenUpdating = False
Dim d As WebDriver
Set d = New ChromeDriver
With d
.AddArgument "--headless"
.Start "Chrome"
End With
For i = 0 To 3
With d
DoEvents
.Get "https://lunarcrush.com/markets?metric=social_volume&filter=&rpp=300&page=&col=1&reverse=" & i
While d.ExecuteScript("return document.readyState") <> "complete": Wend
End With
Application.Wait Now() + TimeValue("0:0:07")
Set a = d.FindElementsByCss(".r-1b43r93")
For Each aa In a
On Error Resume Next
rw = Sheets("Workings").Range("A1048576").End(xlUp).Row + 1
Sheets("Workings").Cells(rw, "A") = aa.Attribute("data-row") & "USDT"
Sheets("Workings").Cells(rw, "B") = aa.FindElementsByTag("td")(4).Text
Sheets("Workings").Cells(rw, "C") = aa.FindElementsByTag("td")(5).Text
Next
Next i