本文介绍了ImportXML和ImportJSON不起作用.如何从动态网站导入数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里是网站: https://www.homesnap. com/CA/Sun-Valley/11027-Cohasset-Street

我希望将值$543,000刮到一个单元格中.

I want the value $543,000 to be scraped into one cell.

ImportXML解析为导入的内容为空".这是公式

ImportXML parsed "imported content is empty". Here is the formula

=ImportXML("https://www.homesnap.com/CA/Sun-Valley/11027-Cohasset-Street","//div[@class='property-header-price']")

和ImportJSON返回

and ImportJSON return

=ImportJSON("https://www.homesnap.com/CA/Sun-Valley/11027-Cohasset-Street","/html/body/div[1]/main/div[4]/div/div[1]/div[1]/div[4]/div[1]/div")

是否有导入数据的建议?

Any advice to import the data?

推荐答案

您还需要其他来源. Google表格不支持抓取JavaScript元素.您只需通过为给定站点禁用JS即可测试JS依赖关系,剩下的可以被清除.在您的情况下,它什么都没有:

you need some other source. Google Sheets does not support the scraping of JavaScript elements. you can test JS dependency simply by disabling JS for a given site and what's left can be scraped. in your case its nothing:

这篇关于ImportXML和ImportJSON不起作用.如何从动态网站导入数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-11 11:54