I\'m having trouble parsing HTML elements with \"class\" attribute using Beautifulsoup. The code looks like this
soup = BeautifulSoup(sdata)
mydivs = soup.fi
As of BeautifulSoup 4+ ,
If you have a single class name , you can just pass the class name as parameter like :
mydivs = soup.find_all('div', 'class_name')
Or if you have more than one class names , just pass the list of class names as parameter like :
mydivs = soup.find_all('div', ['class1', 'class2'])