Brian Kernighan
Brian Kernighan

Reputation: 25

How to get text content on XPath expression

I have like this.

var content = await page.$x("//span[@class='property-number']");

How to get text content inside that expression?

I already try with this, but not working.

var content = await page.evaluate(el => el.innerHTML, await page.$x("//span[@class='property-number']"));

Any help are appreciated.

Upvotes: 0

Views: 951

Answers (1)

xruptronics
xruptronics

Reputation: 2975

Try "//span[@class='property-number']/text()"

Upvotes: 2

Related Questions