For partial matches, `contains()` is your best bet, but watch out for whitespace!
Sometimes `normalize-space()` helps: `//div[contains(normalize-space(), 'error')]`.
If you’re scraping, [Scrapy](https://scrapy.org/) has built-in XPath support and handles messy HTML way better than raw XPath.
Sometimes `normalize-space()` helps: `//div[contains(normalize-space(), 'error')]`.
If you’re scraping, [Scrapy](https://scrapy.org/) has built-in XPath support and handles messy HTML way better than raw XPath.
