Hi, a few years back somebody wrote me some code for scraping football results from a site called betexplorer. macro keeps breaking and when looking at debug it is the line highlighted below (red text) that is causing the problem. Can anybody please suggest what needs changing? it's beyond my knowledge. Thanks
Set ie = New InternetExplorer
url = "BetExplorer - Football statistics - tables, statistics, Football results, odds" & cname & "/" & leg & "/results/"
With ie
.Visible = True
.Navigate url
Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
End With
Set Doc = ie.document
Set leagues = Doc.getElementsByClassName("table-main js-tablebanner-t js-tablebanner-ntb")(0).getElementsByTagName("tr")
'MsgBox leagues.Length
ReDim output(1 To leagues.Length * 15, 1 To 6)
i = 0
k = 0
n = 3
'MsgBox leagues.Length
Dim text1 As String
Set ie = New InternetExplorer
url = "BetExplorer - Football statistics - tables, statistics, Football results, odds" & cname & "/" & leg & "/results/"
With ie
.Visible = True
.Navigate url
Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
End With
Set Doc = ie.document
Set leagues = Doc.getElementsByClassName("table-main js-tablebanner-t js-tablebanner-ntb")(0).getElementsByTagName("tr")
'MsgBox leagues.Length
ReDim output(1 To leagues.Length * 15, 1 To 6)
i = 0
k = 0
n = 3
'MsgBox leagues.Length
Dim text1 As String