首页 > 解决方案 > ImportXML to Google Sheets from Live site values. Error

问题描述

I am trying to import this live value into google sheets using importxml and while I have been successful with other sites this one is giving me some issues.

Currently I am using.

=IMPORTXML("https://dex.guru/token/0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c-bsc","//div[@class='token-value']")

Which returns "error: Imported content is empty".

Any assistance is appreciated especially if it helps me better understand what I am doing wrong. Meanwhile I will keep plucking away at it :D

enter image description here

标签: google-sheets

解决方案


不幸的是,IMPORTXML函数返回的原因Imported content is empty是因为来自URL的数据是由 JavaScript 动态控制的,根据 IMPORTHTML 或 IMPORTXML 的回答从站点帖子收集数据。因此,该函数无法从该 URL 中抓取数据。

我还测试了在访问 https://dex.guru/token/0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c-bsc时禁用浏览器上的 Javascript,并且我已经确认数据确实受到它的控制,因为浏览器显示了消息You need to enable JavaScript to run this app

或者,如果 dex.guru URL 有可用的 API 可供使用,您仍然可以从其抓取数据。但是,在查看他们的网站后,API 选项尚不可用。


推荐阅读