Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.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 apps script 如何将网站链接导入到google sheet?_Google Apps Script_Google Sheets - Fatal编程技术网

Google apps script 如何将网站链接导入到google sheet?

Google apps script 如何将网站链接导入到google sheet?,google-apps-script,google-sheets,Google Apps Script,Google Sheets,我想从导入URL以获得美国最好大学的所有链接 但是,当我使用importXML公式时,比如importXML(“url”,“td[@class='organizationlisting']/@href”),它就不起作用了 我应该怎么做才能用google sheet导入公式获取链接 提前感谢。这将有助于: =importXML("https://www.mastersportal.com/ranking-country/82/united-states.html", "

我想从导入URL以获得美国最好大学的所有链接

但是,当我使用importXML公式时,比如importXML(“url”,“td[@class='organizationlisting']/@href”),它就不起作用了

我应该怎么做才能用google sheet导入公式获取链接

提前感谢。

这将有助于:

=importXML("https://www.mastersportal.com/ranking-country/82/united-states.html", "//table//tr//a/@href")

我相信你的目标如下

  • 您想从
    https://www.mastersportal.com/ranking-country/82/united-states.html
在这个答案中,
//td[@data title='universions']/a/@href
用作xpath

修正公式: 结果: 在当前阶段,似乎检索了258个超链接

参考:

非常感谢您的帮助。我真不敢相信我只是在你的博客上读了[link]shorturl.at/wDJK3,然后你在这里回答了我的问题。谢谢你的帮助。现在,我知道我的公式出了什么问题。
=IMPORTXML("https://www.mastersportal.com/ranking-country/82/united-states.html","//td[@data-title='Universities']/a/@href")