timtam
timtam

Reputation: 23

how to extract a tag which does not have a particular attribute

I know that I can do:

soup.findAll("p", {"class" :"something"})

but I'm looking for p-tags that DON't have any class. how do I make sure I only get p-tags with no class attribute??

Upvotes: 1

Views: 160

Answers (1)

jcomeau_ictx
jcomeau_ictx

Reputation: 38412

soup.findAll('p', {'class': None})

Upvotes: 3

Related Questions