I would like to find an XPath expression which, when applied to the page at:
https://ftp.opera.com/pub/opera-beta/
will return the text of the final <a>
element whose href
attribute value starts with a number.
If I had just wanted the final <a>
element I could have simply written:
//body/pre/a[last()]/text()
but unfortunately the last element on this page looks like this:
<a href="info/">info/</a>
What I want is the last element whose href
attribute has a value that starts with a number . This is currently this value:
<a href="41.0.2353.30/">41.0.2353.30/</a>
so what alternate XPath expression can I use to return the last value that starts with a number?
如果使用(//a[number(substring(@href, 1, 1)) = number(substring(@href, 1, 1))])[last()]
,则选择文档中的最后a
元素href
属性,其中第一个字符是数字。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.