0
votes

Basic Xpath question: I'm using desktop app to scrape webpage for numeric dollar amount found in span tag, under the path.

//div[contains(@class,'ProductDetailInfoBlock-pricing-amount')]/span

$35.12 (only thing within span) comes back surrounded with assorted blank spaces and 9 line breaks. How do I apply normalize-space() to this result found in span?

The application doesn't allow:

normalize-space(//div[contains(@class,'ProductDetailInfoBlock-pricing-amount')]/span)

How its done- Applying it to /span? thanks!

1

1 Answers

0
votes

try this:

normalize-space(//div[contains(@class,'ProductDetailInfoBlock-pricing-amount')]/span/text())

just add /text() in the end, as you are trying to normalize it, not the node)