Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/string/5.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
使用Google Sheets中的IMPORTXML函数从表导入数据_Xml_Import_Google Sheets - Fatal编程技术网

使用Google Sheets中的IMPORTXML函数从表导入数据

使用Google Sheets中的IMPORTXML函数从表导入数据,xml,import,google-sheets,Xml,Import,Google Sheets,首先,我完全不称职,我花了数小时试图让这项工作成功,但都没有结果。所以,请跟我说,就像我对编码一无所知一样,顺便说一句,这是真的 这是: <tr> <td colspan="6" class="ar lt pb5">186,272</td> </tr> 我试图导入到GoogleSheets单元格的是186272位 完整的代码可以在这里找到:186272部分在最后 到目前为止,我通过xpath_查询提取表的正确部分或任何部分的尝试都没有成功,我98

首先,我完全不称职,我花了数小时试图让这项工作成功,但都没有结果。所以,请跟我说,就像我对编码一无所知一样,顺便说一句,这是真的

这是:

<tr>
<td colspan="6" class="ar lt pb5">186,272</td>
</tr>
我试图导入到GoogleSheets单元格的是186272位

完整的代码可以在这里找到:186272部分在最后

到目前为止,我通过xpath_查询提取表的正确部分或任何部分的尝试都没有成功,我98%确定我做错了什么

请告诉我。

正确的xpath是:

//td[@class="ar lt pb5"][@colspan="6"]/text()

谢谢,但是我在使用这个时仍然会遇到一个公式解析错误:=IMPORTXML,//td[@class=ar lt pb5][@colspan=6]/text我不知道您使用的工具。测试时使用xmllint:xmllint-xpath'//td[@class=ar lt pb5][@colspan=6]/text'http://www.sportsclubstats.com/d/NHL/Western/Pacific/Edmontonlottery27D.xml 186,272