Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xpath 如何创建深度嵌套的XML?_Xpath_Web Scraping_Google Sheets_Google Sheets Importxml - Fatal编程技术网

Xpath 如何创建深度嵌套的XML?

Xpath 如何创建深度嵌套的XML?,xpath,web-scraping,google-sheets,google-sheets-importxml,Xpath,Web Scraping,Google Sheets,Google Sheets Importxml,我正在尝试使用importxml函数将XML数据刮到Google工作表中。我以前尝试过使用importhtml函数,但是您需要使用的“列表”和“表”查询不起作用 我似乎无法在一个简单的市场数据网页中找到正确的方法来获取“价格(GBX)”值,例如 我曾尝试使用按div、span和类名搜索,但没有任何进展 我还尝试复制XPath/html/body/div[3]/div[2]/section[1]/div/div/div[1]/div[3]/ul/li[1]/span[2] 但这似乎不起作用 是否可

我正在尝试使用
importxml
函数将XML数据刮到Google工作表中。我以前尝试过使用importhtml函数,但是您需要使用的“列表”和“表”查询不起作用

我似乎无法在一个简单的市场数据网页中找到正确的方法来获取“价格(GBX)”值,例如

我曾尝试使用按div、span和类名搜索,但没有任何进展

我还尝试复制XPath
/html/body/div[3]/div[2]/section[1]/div/div/div[1]/div[3]/ul/li[1]/span[2]
但这似乎不起作用

是否可以通过在Google Sheets中的XML抓取来检索非常嵌套的数据?

尝试使用

=IMPORTXML(A1,"//ul/li/span[@class='mod-ui-data-list__label'][contains(text(),'GBX')]/following-sibling::span")
输出:

7576.00