Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html href链接的XPath_Html_Xml_Xpath_Href - Fatal编程技术网

Html href链接的XPath

Html href链接的XPath,html,xml,xpath,href,Html,Xml,Xpath,Href,例如,我得到了 <a href="target.php">News</a> <a href="more.php">More</a> 使用XPath根据(原子数据)之间的值提取href的最有效方法是什么 “最有效”在程序员的时间意义上是指,而不是 在性能方面 “value between”表示a标记之间的字符串 此XPath选择所有a元素 //a 此XPath选择字符串值为“News”的所有a元素: 此XPath选择字符串值为“News”

例如,我得到了

<a href="target.php">News</a>
<a href="more.php">More</a>


使用XPath根据
(原子数据)之间的值提取
href
的最有效方法是什么

  • “最有效”在程序员的时间意义上是指,而不是 在性能方面
  • “value between”表示
    a
    标记之间的字符串
此XPath选择所有
a
元素

//a
此XPath选择字符串值为“News”的所有
a
元素:

此XPath选择字符串值为
“News”
1的所有
a
元素的所有
href
属性:


一,。信用:在评论中发布了正确答案

//a/@href
。基于值between意味着什么?关于值between-您的意思是按节点值选择
href
属性?
//a[.='News']/@href
//a[.='News']
//a[.='News']/@href