=importXML() 中的 xpath 用于提取元描述
我正在尝试使用 Xpath 使用 Google Sheets 从网页中提取元描述。
我正在努力提取标题: =importXml(www.example.com; "//title")
以下是我的两个学习来源:
http://seogadget.co.uk/playing-around-with-importxml-in-google-spreadsheets/
http://docs.google.com/support/bin /answer.py?hl=en&answer=75507
我已经阅读了此网站上的许多其他帖子,这似乎与我想要的内容类似:
"/html/head/meta[@name='description']/@content"
"/*/head/meta[@name='description']/@content"
"//head/meta[@name=\"description\"]/@content"
这些在 Google 表格中都不起作用,它指定将其写入 Xpath 中。唯一的区别是,在 Google 表格中,您要使用 ' 代替 "(因此描述是这样的)。老实说,我已经尝试了大约 219 种不同的方法......没有运气。
有什么想法吗?提前致谢!
I'm trying to use Xpath to pull in the meta descriptions from web pages, using Google Sheets.
I have this working to pull in the titles: =importXml(www.example.com; "//title")
Here are two sources of my learning:
http://seogadget.co.uk/playing-around-with-importxml-in-google-spreadsheets/
http://docs.google.com/support/bin/answer.py?hl=en&answer=75507
I have read many other posts on this site, and this seems to be the similar idea of what I want:
"/html/head/meta[@name='description']/@content"
"/*/head/meta[@name='description']/@content"
"//head/meta[@name=\"description\"]/@content"
None of these work in Google Sheets, which specifies to write it in Xpath. The only difference, is that in Google Sheets you are to use ' in place of " (hence why description is like that). I've honestly tried it about 219 different ways....no luck.
Any ideas? Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所以你在谷歌表中的完整 URL 调用将是
我已经使用 importXML 构建了一些很棒的 SEO 工具 - 这只是它的开始,伙计! :)
So your full URL call in google sheet would be
I've built some awesome SEO tools using importXML - this is just the start of it mate! :)