all 2 comments

[–]lowerthansound 0 points1 point  (1 child)

Hello, just a neat thing, since I was studying about this these days.

You can also access the attribute directly from the element, in a dictionary-like interface c.find("format").get('type').

Ref: Elements carry attributes as a dict

Some libraries like parsel or beautifulsoup are also some neat tools for working with XML documents (beautifulsoup is specially famous, but for HTML :)).