I\'m having trouble parsing HTML elements with \"class\" attribute using Beautifulsoup. The code looks like this
soup = BeautifulSoup(sdata) mydivs = soup.fi
This worked for me:
for div in mydivs: try: clazz = div["class"] except KeyError: clazz = "" if (clazz == "stylelistrow"): print div