xpath how can I select elements that have a number inside text?

Viewed 40
<span>Постов: 223 / Файлов: 10</span>
<span>Постов: 23 / Файлов: 0</span>
<span>Постов: 63 / Файлов: 6</span>

How can I select all spans containing number <99 after "Постов: "

I tried this

//span[contains(text(), "Постов: ") and number(substring(text(), 9, 3))<99]
1 Answers

The number you want appears after "Постов: " and before " /". So you can use substring-after() and substring-before().

//span[substring-before(substring-after(text(),'Постов: '),' /') < 99]
Related