F. Vosnim
F. Vosnim

Reputation: 574

How to get value inside the span using XPATH?

I'm trying to get value 4,023,484 from this span:

I tried this line with no luck:

//span[contains(text(),'posts')]

What am I doing wrong?

Upvotes: 1

Views: 57

Answers (1)

Andersson
Andersson

Reputation: 52695

Try this one to get required value:

//span[contains(.,'posts')]/span

or

//span[normalize-space(text()[2])='posts']/span

Upvotes: 1

Related Questions