Find div without class (web scraping)

Question:

How to find a div without any class like in below example the div has a class

authordiv = soup.find('div', attrs={'class': 'list-authors'})
Asked By: M Talha Afzal

||

Answers:

If you want to find divs without class, try this:

soup.find('div', attrs={'class': None})

If your problem is to find any div (with or without class), just remove the second argument

Answered By: JBernardo

Use None object as a class name:

soup.find('div', attrs={'class': None})
Answered By: Gavelock