Hi to everybody, I'm using IE, but this method is slow so I want to change it to XLMHTTP.
I have tried but no output.
This is my IE code:
Thanks a lot
Regards
I have tried but no output.
This is my IE code:
VBA Code:
Sub inplay()
Dim IE As Object
Dim item As Object
Dim r As Integer
Dim myurl As String
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Set IE = CreateObject("InternetExplorer.application")
myurl = "https://www.nowgoal.pro/"
With IE
.navigate myurl
.Visible = False
Do While IE.Busy = True Or IE.readyState <> 4: DoEvents: Loop
End With
Application.Wait (Now + TimeValue("00:00:10"))
r = 2
For Each item In IE.document.getElementsByClassName("item")
With Sheets("inplay")
.Range("A" & r).Value = item.getElementsByClassName("gameName leaRow")(0).innerText
.Range("B" & r).Value = Trim(item.getElementsByClassName("homeTeam").item(0).getElementsByTagName("span").item(0).innerText)
.Range("C" & r).Value = Trim(item.getElementsByClassName("guestTeam").item(0).getElementsByTagName("span").item(0).innerText)
'others
End With
r = r + 1
Next item
IE.Quit
Set IE = Nothing
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
Thanks a lot
Regards