从“a href”中提取链接

时间:2012-04-16 08:49:23

标签: xpath

xmllint sample.xml --xpath "//a[text()='some value']/@href"

输出:

href="http://some.address"

如何只输出没有属性名称的链接?

1 个答案:

答案 0 :(得分:2)

xmllint sample.xml --xpath "string(//a[text()='some value']/@href)"

相关问题