为什么importxml和importhtml在这里不起作用? [英] Why importxml and importhtml not working here?

查看:187
本文介绍了为什么importxml和importhtml在这里不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

=Importhtml("https://app.neilpatel.com/en/ubersuggest/keyword_ideas?keyword=Food%20Chart&locId=2840&lang=en", "table", 3)


=ImportXML("https://app.neilpatel.com/en/ubersuggest/keyword_ideas?keyword=Food%20Chart&locId=2840&lang=en","//div[@class='css-19jz7zx']")

我使用上面的公式在我的Google表格中获取关键字.但我只得到#N/A

(错误 导入的内容为空)

我无法理解公式出了什么问题,为什么我无法获取数据.请帮助我.

解决方案

我认为您出现此问题的原因是由于You need to enable JavaScript to run this app.,当使用IMPORTXML和Google Apps Script从URL检索值时会显示You need to enable JavaScript to run this app../p>

例如,当通过//body的xpath检索站点时,仅返回You need to enable JavaScript to run this app.的值.

不幸的是,电子表格的内置功能无法运行Javascript.由此,发生这种错误.在这种情况下,即使使用Google Apps脚本,也无法直接从URL检索值.

=Importhtml("https://app.neilpatel.com/en/ubersuggest/keyword_ideas?keyword=Food%20Chart&locId=2840&lang=en", "table", 3)


=ImportXML("https://app.neilpatel.com/en/ubersuggest/keyword_ideas?keyword=Food%20Chart&locId=2840&lang=en","//div[@class='css-19jz7zx']")

I use the above formula to get keywords in my google sheet. but I only get #N/A

(Error Imported content is empty)

I'm unable to understand what is wrong with my formula, why I'm unable to get data. please help me with this.

解决方案

I think that the reason of your issue is due to You need to enable JavaScript to run this app. which are shown when the value is retrieved from the URL with IMPORTXML and Google Apps Script.

For example, when the site is retrieved by the xpath of //body, only the value of You need to enable JavaScript to run this app. is returned.

Unfortunately, the built-in functions of Spreadsheet cannot be run the Javascript. By this, such error occurs. In this case, even when Google Apps Script was used, the values cannot be directly retrieved from the URL.

这篇关于为什么importxml和importhtml在这里不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆