I\'m having trouble parsing HTML elements with \"class\" attribute using Beautifulsoup. The code looks like this
soup = BeautifulSoup(sdata) mydivs = soup.fi
Try to check if the div has a class attribute first, like this:
soup = BeautifulSoup(sdata) mydivs = soup.findAll('div') for div in mydivs: if "class" in div: if (div["class"]=="stylelistrow"): print div