繁体   English   中英

如何从网站(任何URL)使用xpath(xpath_query)获取href链接?

[英]How to get a href link using xpath (xpath_query) from website (any url)?

我想从此网址获取我的社交链接。

http://profiles.wordpress.org/mahesh901122

Mahesh Waghmare的头像

Member Since: October 6th, 2012
Pune, Maharashtra, India
Wordpress Developer

Find me on: https://www.facebook.com/mwaghmare7
            http://profiles.google.com/101103699636703768957

我尝试过:// a [@ id ='user-social-media-accounts'] / @ href,但它无法返回任何网址。 建议将xpath_query用于Google spreedsheet或其他获取这些链接的方法。 适用于wordpress / php开发人员的任何技巧。

user-social-media-accounts<ul>标签的id ,而不是<a>标签的ID。 使用Google电子表格进行测试时,该XPath能够按预期返回3个社交媒体网址:

//ul[@id='user-social-media-accounts']/li/a/@href

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM