具有交替行的IMPORTXML表
我想使用Google Sheet IMPORTXML函数从Fangraphs页面只导入“1B”列 我能够使用此功能:具有交替行的IMPORTXML表,import,google-sheets,Import,Google Sheets,我想使用Google Sheet IMPORTXML函数从Fangraphs页面只导入“1B”列 我能够使用此功能: =importxml("http://www.fangraphs.com/statsd.aspx?playerid=9166&position=C&type=1&gds=&gde=&season=2015", "//tr[@class='rgRow']/td[10]") 导入表中的其他每一行,因为该表被分为“rgRow”和“rgAltRo
=importxml("http://www.fangraphs.com/statsd.aspx?playerid=9166&position=C&type=1&gds=&gde=&season=2015", "//tr[@class='rgRow']/td[10]")
导入表中的其他每一行,因为该表被分为“rgRow”和“rgAltRow”两类。但是,我需要导入每一行
我还想一直导入列表,而不是在每个新标题处停止
这怎么可能呢?我宁愿不要使用多个IMPORTXML函数以保持页面快速运行。假设这是一个xpath查询,请尝试以下操作:
=importxml("http://www.fangraphs.com/statsd.aspx?playerid=9166&position=C&type=1&gds=&gde=&season=2015", "//tr[@class='rgRow']/td[10] | //tr[@class='rgAltRow']/td[10]")
注意,添加了
|
字符(表示“or”)和//tr[@class='rgAltRow']/td[10]
Ahh的第二个表达式,这很有意义。谢谢你的帮助。