在 YQL 中使用 xpath 从网页获取锚文本

发布于 2024-08-31 23:34:55 字数 530 浏览 5 评论 0原文

SELECT content FROM html WHERE url="http://en.wikipedia.org/wiki/List_of_United_States_National_Parks_by_state" AND xpath="//a/text()"

不起作用,反之则

SELECT * FROM html WHERE url="http://en.wikipedia.org/wiki/List_of_United_States_National_Parks_by_state" AND xpath="//a/text()"

有效。

SELECT content FROM html WHERE url="http://en.wikipedia.org/wiki/List_of_United_States_National_Parks_by_state" AND xpath="//a"

也有效,看来 YQL 有错误,还是我遗漏了什么?

SELECT content FROM html WHERE url="http://en.wikipedia.org/wiki/List_of_United_States_National_Parks_by_state" AND xpath="//a/text()"

does not work, whereas

SELECT * FROM html WHERE url="http://en.wikipedia.org/wiki/List_of_United_States_National_Parks_by_state" AND xpath="//a/text()"

does.

SELECT content FROM html WHERE url="http://en.wikipedia.org/wiki/List_of_United_States_National_Parks_by_state" AND xpath="//a"

also works, it seems YQL has a bug, or am I missing something?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

¢蛋碎的人ぎ生 2024-09-07 23:34:55

这是您要找的吗?

SELECT content FROM html WHERE url="http://en.wikipedia.org/wiki/List_of_United_States_National_Parks_by_state" AND xpath="//a"

Is this what you are looking for?

SELECT content FROM html WHERE url="http://en.wikipedia.org/wiki/List_of_United_States_National_Parks_by_state" AND xpath="//a"
生生漫 2024-09-07 23:34:55
SELECT href
FROM html
WHERE url="http://en.wikipedia.org/wiki/List_of_United_States_National_Parks_by_state"
      AND xpath="//a"

在 YQL 上尝试 控制台

SELECT href
FROM html
WHERE url="http://en.wikipedia.org/wiki/List_of_United_States_National_Parks_by_state"
      AND xpath="//a"

Try it on the YQL console.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文