VBA Excel从网站表中获取第一行数据

我正在使用VBA Excel从互联网抓取一些数据。 链接是:

http://www.baseball-reference.com/boxes/BOS/BOS199004090.shtml

我想提取这些行,每个元素在不同的单元格中:

Jack Morris,L(0-1)6.2 7 5 2 3 3 0 2.7 31 95 52 31 7 14 8 17 5 0 46 -0.252 0.62 -2.1

我的代码:

Set objIE = CreateObject("InternetExplorer.Application") objIE.Top = 0 objIE.Left = 0 objIE.Width = 800 objIE.Height = 600 objIE.Visible = True objIE.Navigate ("http://www.baseball-reference.com/boxes/BOS/BOS199004090.shtml") Do DoEvents If Err.Number <> 0 Then objIE.Quit Set objIE = Nothing GoTo j: End If Loop Until objIE.ReadyState = 4 item = objIE.Document.getElementsByClassName("suppress_csv sortable stats_table now_sortable")(0).getElementsByTagName("td")(0) 

我尝试了不同的组合来提取我的项目,但似乎没有任何工作。 先谢谢你。

find答案:m从0到任何….

 Set tbl = objIE.Document.getElementsByClassName("overthrow table_container")(2).getElementsByTagName("tr")(1).getElementsByTagName("td")(m).innerText