使用ImportXML和XPath捕获元素 [英] Capture element using ImportXML with XPath
本文介绍了使用ImportXML和XPath捕获元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
I'm trying to get the following information via Google Sheets from the page as an example here.
我必须检索这两个用红色圈起来的项目,如所附的抓取数据的截图所示.
I have to retrieve these two items circled in red as in the attached screenshot of scrape data interest.
我已经尝试过了,但是它不起作用(在A1中有链接,在B1中有公式):
I've tried this, but it does not work (in A1 there is the link, and B1 the formula):
=IMPORTXML(A1;"/html/body/div[1]/div[2]/div[1]/span[1])
=IMPORTXML(A1;"/html/body/div[1]/div[3]/table/tbody/tr[1]/td[3])
有没有人可以帮助我?
推荐答案
他们的robots.txt文件:
Their robots.txt file:
User-Agent: *
Disallow: /
用户代理:*"表示此部分适用于所有机器人. "Disallow:/"(禁止:/)告诉机器人,它不应访问该网站上的任何页面..
可以使用Excel从Web提取所需的信息.
Information required could be extracted with Excel, From Web.
这篇关于使用ImportXML和XPath捕获元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文