我正在尝试将下面链接的表格(Fangraphs)中显示的数据拉到我的Google工作表上。
链接到网站上的表格:
使用ImportHTML,我只能从链接中拉出表#1、2、3,它们都不是正确的表。
使用ImportXML时,我一直使用下面的代码得到公式解析错误:
=IMPORTXML("https://www.fangraphs.com/leaders/splits-leaderboards?splitArr=8,131&splitArrPitch=&position=B&autoPt=false&splitTeams=false&statType=player&statgroup=2&startDate=2014-03-01&endDate=2019-11-01&players=&filter=AB%7Cgt%7C5&sort=16,1&pageitems=10000000000000&pagenum=0","//*[@id="react-drop-test"]/div[2]/div/div[1]/div/div[1]/table)")我尝试过的代码:
ImportHTML:
=IMPORTHTML("https://www.fangraphs.com/leaders/splits-leaderboards?splitArr=8,131&splitArrPitch=&position=B&autoPt=false&splitTeams=false&statType=player&statgroup=2&startDate=2014-03-01&endDate=2019-11-01&players=&filter=AB%7Cgt%7C5&sort=16,1&pageitems=10000000000000&pagenum=0", "table",4)ImportXML:
=IMPORTXML("https://www.fangraphs.com/leaders/splits-leaderboards?splitArr=8,131&splitArrPitch=&position=B&autoPt=false&splitTeams=false&statType=player&statgroup=2&startDate=2014-03-01&endDate=2019-11-01&players=&filter=AB%7Cgt%7C5&sort=16,1&pageitems=10000000000000&pagenum=0","//*[@id="react-drop-test"]/div[2]/div/div[1]/div/div[1]/table)")```
I want the table headers and all the data below to be pulled into my Google sheet. I've done this with other Fangraph links.发布于 2019-07-22 14:31:55
不幸的是,这是不可能的,因为该网站是由JavaScript控制的,而Google Sheets不能理解/导入JS。您可以简单地通过禁用给定链接的JS进行测试,您将看到一个空白页面:

https://stackoverflow.com/questions/57138094
复制相似问题