“导入的内容为空".谷歌表 [英] "Imported content is empty" Google Sheet

查看:58
本文介绍了“导入的内容为空".谷歌表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

=IMPORTXML("https://www.tradingview.com/chart/1BxJl0Xz/", "//body/div/div/div/div/div/table/tr[3]/td/div/div/div/div[1]/div[1]/div[3]/div/div/div")

所以我正在尝试提取此信息

So i am trying to extract this information

到我的Google表格,但我只是说导入的内容为空.有人知道如何解决此问题吗? :(

to my google sheets but i it just says that imported content is empty. Anybody have any idea how to fix this issue? :(

我尝试在Google表格中使用的路径行来自chrome控制台中的行

The path line i tried using inside my google sheet comes from this line in chrome console

推荐答案

这将不起作用,因为该页面似乎正在使用javascript生成内容.

This isn't going to work because that page appears to be using javascript to generate the content.

因此,尽管xpath有效(我猜是因为我在该页面上检查并自己尝试过),但在使用importXML时xpath实际上并不存在,因为这不会触发javascript.

So while the xpath is valid (I'd guess since I checked on that page and tried this myself) the xpath doesn't actually exist when you use importXML because that will not trigger the javascript.

如果您运行wget或使用下面的Powershell,则可以浏览原始内容,并发现由于没有运行javascript而在浏览器中看到的值不存在.

If you run wget or use the powershell below, you can browse the raw content and see that the values you see in a browser don't exist because no javascript is running.

(iwr" https://www.tradingview.com/chart/1BxJl0Xz/).RawContent |更多

(iwr "https://www.tradingview.com/chart/1BxJl0Xz/").RawContent | more

您需要执行其他操作才能实现此目的.

You'll need to do something else to make this happen.

这篇关于“导入的内容为空".谷歌表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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