使用IMPORTXML导入表 [英] Import table using IMPORTXML
问题描述
我正在尝试从 https://rotogrinders.com/schedules/nfl 上拉表格进入Google表格
I am trying to pull the table from https://rotogrinders.com/schedules/nfl into Google Sheets
我尝试使用ImportHTML(" https://rotogrinders.com/schedules/nfl ","table",1),但只返回标题:
I tried using ImportHTML("https://rotogrinders.com/schedules/nfl", "table", 1) but it just returns the header:
时间队对手线钱线超过/低于预测点预测点变化
Time Team Opponent Line Moneyline Over/Under Projected Points Projected Points Change
我使用ImportXML,尝试了IMportXML(" https://rotogrinders.com/schedules/nfl ,"//tr),但它返回相同的标头,但没有数据.
Using ImportXML, I tried IMportXML("https://rotogrinders.com/schedules/nfl","//tr"), but it returns the same header and no data.
我不认为该主体需要身份验证才能访问.我注销,清除了缓存,甚至尝试在另一台计算机上也没有提示.
I dont think the tbody needs authentication to access. I logged out, cleared my cache and even tried on another computer and still no tbody.
我知道它的表称为"tschedules",但无法获取数据
I know its a table called "tschedules", but cant get the data
我还缺少XPATH的另一部分吗?
Is there another part of the XPATH I am missing?
这是Google抓取工具的XPATH:"//table [1]/tbody/tr [td]"
This is the XPATH from google scraper: "//table[1]/tbody/tr[td]"
推荐答案
当您加载该网站时,实际表将在几秒钟内不会加载.这就是为什么看不到任何数据的原因.如果您可以为导入调用设置一些等待时间,那么它将起作用.
When you load this website the actual table doesn't load in for a few seconds. This is why you're not seeing any data come in. If you can set some wait time on that import call somehow then it would work.
这篇关于使用IMPORTXML导入表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!