Update to BeautifulSoup 4 + fix parser for bs4

In bs4, tag.get('class') is a list of classes. This commit fixes
the parser accordingly.