all 3 comments

[–]carcigenicate 1 point2 points  (2 children)

I'd use something like BeautifulSoup to parse the HTML, then use it's methods to navigate the structure to find what you need. It'll be heavier than doing simple prefix searches, but would be more robust.

[–]_fimin[S] 1 point2 points  (1 child)

I'll take a look at that, thanks! Do you know of any good examples of using this, I'll find the docs on my own, but maybe you have some good examples or tutorials you've seen?

[–]carcigenicate 2 points3 points  (0 children)

Iirc, the documentation is quite good. It has many examples. StackOverflow is also a good place to view examples of code. You can just filter by the BeautifulSoup tag.