开发者

Getting anchor text from a webpage using xpath within YQL

开发者 https://www.devze.com 2022-12-30 15:56 出处:网络
SELECT content 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/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?


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"


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消