No change in the usage, except that the class attribute is now a list.
import decimal
import urllib2
-from BeautifulSoup import BeautifulSoup
+from bs4 import BeautifulSoup
from insider.models import add_transaction
elif field == '':
line_match = True
break # we made it to the end of the list
- if dict(tds[i].attrs).get('class', None) != class_:
+ classes = dict(tds[i].attrs).get('class', [])
+ if class_ and class_ not in classes:
break # wrong class
value = tds[i].text
if class_ == 'Holdnum': # decode numerical values