我只是真的在努力与xPath
。我已经阅读了一些指南,我似乎无法得到正确的答案。使用xpath来提取hreflang的URL
基本上,我想提取所有包含"/ro_ro/"
的URLs
。
<link rel="alternate" href="https://www.stackoverflow.com/pl_pl/" hreflang="pl-PL">
<link rel="alternate" href="https://www.stackoverflow.com/pt_br/" hreflang="pt-BR">
<link rel="alternate" href="https://www.stackoverflow.com/pt_pt/" hreflang="pt-PT">
<link rel="alternate" href="https://www.stackoverflow.com/ro_ro/" hreflang="ro-RO">
<link rel="alternate" href="https://www.stackoverflow.com/fi_fi/" hreflang="fi-FI">
理想情况下,xpath
查询将返回:https://www.stackoverflow.com/ro_ro/。
我已经接近,但页面上有多个链接到URL
,但从来没有与hreflang
属性。
我这样做大规模地,我要指出,这意味着我想提取的样子深深的网页网址:https://www.stackoverflow.com/ro_ro/xpath-help-for-a-noob/
编辑:任何想法,为什么这让downvotes?
感谢您回应获得在谷歌电子表格中的hreflang,这似乎不适合我,虽然工作的任何想法 –
你的意思是'似乎不适合我'吗?你得到不正确的输出或者你得到错误?这是纯粹的'XPath'解决方案,而你使用的工具可能不支持它... – Andersson
嗨安德森,对不起我的错误,它的工作原理。非常感谢! –