如何處理執行時,在這句出錯. Set trs = tbl.getElementsByTagName(“tr”),應如何處理. 謝謝幫忙
Sub Test() Cells.Clear Set IE = CreateObject("internetexplorer.application") IE.navigate "https://racing.on.cc/racing/rat/current/rjrati0001x0.html" Application.Wait (Now + TimeValue("0:00:03")) Set tbl = IE. Document.getElementsByTagName("table")(5) Set trs = tbl.getElementsByTagName("tr") For I = 8 To 30 Set tds = trs(I).getElementsByTagName("td") For J = 0 To tds. Length - 1 Cells(I + 1, J + 1) = tds(J).innerText Next Next
End Sub
|