Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.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 通过google电子表格导入XML函数选择特定文本后的字段_Xpath_Google Sheets_Google Sheets Importxml - Fatal编程技术网

Xpath 通过google电子表格导入XML函数选择特定文本后的字段

Xpath 通过google电子表格导入XML函数选择特定文本后的字段,xpath,google-sheets,google-sheets-importxml,Xpath,Google Sheets,Google Sheets Importxml,我正在尝试使用Google Sheets的importxml函数从链接中获取以下数据: Kategorie(n): Mehrfamilienhaus Schätzwert: 100.000,00 EUR 因为我想在其他链接上使用XPath,所以我想对其进行结构化,使其选择文本Schätzwert:或Kategorie(n):之后的文本。我尝试了以下方法: =IMPORTXML(A2,"//tr/td[@class='tlabel' | text()='Schätzwert:']/f

我正在尝试使用Google Sheets的importxml函数从链接中获取以下数据:

Kategorie(n):   Mehrfamilienhaus
Schätzwert:     100.000,00 EUR
因为我想在其他链接上使用XPath,所以我想对其进行结构化,使其选择文本
Schätzwert:
Kategorie(n):
之后的文本。我尝试了以下方法:

=IMPORTXML(A2,"//tr/td[@class='tlabel' | text()='Schätzwert:']/following-sibling::div/text()")
我想为Kategorie(n)做一些类似的事情:

Mehrfamilienhaus在
A2

=importxml(A2,"//*[@id='diveddoc']/div[1]/table/tbody/tr[22]/td[2]")
=INDEX(IMPORTHTML(A2,"table",0),22,2)
10万欧元

=importxml(A2,"//*[@id='diveddoc']/div[2]/table/tbody/tr[20]/td[2]/div")
=INDEX(IMPORTHTML(A2,"table",0),27,2)
由于数据在一个表中,您还可以使用 为迈赫里恩豪斯

=importxml(A2,"//*[@id='diveddoc']/div[1]/table/tbody/tr[22]/td[2]")
=INDEX(IMPORTHTML(A2,"table",0),22,2)
10万欧元

=importxml(A2,"//*[@id='diveddoc']/div[2]/table/tbody/tr[20]/td[2]/div")
=INDEX(IMPORTHTML(A2,"table",0),27,2)