【发布时间】:2018-09-16 18:53:05
【问题描述】:
我想从this page 中删除数据,但是,我无法为=importxml 函数获取正确的xpath。
我想获得跨度类name 和rate。
例如
column A, column B
Robert Mistrík, 2.5
你知道我应该创建什么 xpath 吗?
【问题讨论】:
标签: xml google-sheets
我想从this page 中删除数据,但是,我无法为=importxml 函数获取正确的xpath。
我想获得跨度类name 和rate。
例如
column A, column B
Robert Mistrík, 2.5
你知道我应该创建什么 xpath 吗?
【问题讨论】:
标签: xml google-sheets
这就是你获得名字的方式
//span[@class='name']
这就是您可以提取特定字体评级的方法
//span[@class='name'][contains(.,'Róbert Mistrík')]/following-sibling::span[@class='rate']
如果您需要提取所有字体及其对应的值,那么您需要首先使用//span[@class='name'] 找到字体名称,您将获得字体名称,例如Róbert Mistrík 那么你必须在 //span[@class='name'][contains(.,'Róbert Mistrík')]/following-sibling::span[@class='rate'] xpath 的 contains 方法中传递相同的内容。
【讨论】:
=IMPORTXML("https://m.tipsport.sk/prematch/match/2921022/events","//span[@class='name']"),它只会返回#N/A。
=IMPORTXML("https://m.tipsport.sk/prematch/match/2921022/events","//span[@class='name']/text()")