bye*_*ary 1 html xml xpath href
我举个例子
<a href="target.php">News</a>
<a href="more.php">More</a>
Run Code Online (Sandbox Code Playgroud)
用XPath 提取href基于<a></a>(原子数据)之间的值的最有效方法是什么
问题解释:
a。该XPath选择所有a元素,
//a
Run Code Online (Sandbox Code Playgroud)
该XPath选择所有a字符串值是的元素"News":
//a[.='News']
Run Code Online (Sandbox Code Playgroud)
该XPath选择字符串值为1href的所有a元素的所有属性:"News"
//a[.='News']/@href
Run Code Online (Sandbox Code Playgroud)
1.信用:@localghost在评论中发布了正确答案
| 归档时间: |
|
| 查看次数: |
6079 次 |
| 最近记录: |