lxml is my go-to for *parsing html with python* when performance matters. It’s lightning-fast and works great for scraping.
But yeah, regex is a no-go for HTML. It’s like using a hammer for a job that needs a screwdriver.
For messy HTML, I’d recommend using `html5lib` with BeautifulSoup. It’s slower but handles broken tags like a champ.
Also, check out Scrapy if you’re doing more than just parsing. It’s a full framework and makes scraping way easier.
But yeah, regex is a no-go for HTML. It’s like using a hammer for a job that needs a screwdriver.
For messy HTML, I’d recommend using `html5lib` with BeautifulSoup. It’s slower but handles broken tags like a champ.
Also, check out Scrapy if you’re doing more than just parsing. It’s a full framework and makes scraping way easier.
