I’m parsing HTML and I need to get only tags with selector like div.content.
For parsing I’m using HTMLParser. I’m so far that I get list of tags’ attributes.
It looks something like this:
[('class', 'content'), ('title', 'source')]
The problem is that I don’t know how to check that:
- List have tuple with 1st element called
class, - Values of tuples 1st element (it will be 2nd element) is
content;
I know this is easy question, but I’m quite new with Python as well. Thanks in any advice!
When looping through your elements: