thekarangoel/TPB — pull request #31 by sohailprasad (2013-09-30 04:25:08+00:00)
Title: make BeautifulSoup use lxml to avoid bad html parsing errors

Some ad code on TPB is causing "bad end tag" errors with python's built-in HTML parser. Pull request to use lxml as a parser.

Previous error:

> /TPB/venv/lib/python2.7/site-packages/bs4/builder/_htmlparser.py:155: RuntimeWarning: Python's built-in HTMLParser cannot parse the given document. This is not a bug in Beautiful Soup. The best solution is to install an external parser (lxml or html5lib), and use Beautiful Soup with that parser. See http://www.crummy.com/software/BeautifulSoup/bs4/doc/#installing-a-parser for help.
> "Python's built-in HTMLParser cannot parse the given document. This is not a bug in Beautiful Soup. The best solution is to install an external parser (lxml or html5lib), and use Beautiful Soup with that parser. See http://www.crummy.com/software/BeautifulSoup/bs4/doc/#installing-a-parser for help."))
>Traceback (most recent call last):
> File "", line 1, in
> File "tpb/tpb.py", line 157, in items
> for item in super(Paginated, self).items():
> File "tpb/tpb.py", line 74, in items
> page = BeautifulSoup(content)
> File "/TPB/venv/lib/python2.7/site-packages/bs4/__init__.py", line 183, in __init__
> self._feed()
> File "/TPB/venv/lib/python2.7/site-packages/bs4/__init__.py", line 197, in _feed
> self.builder.feed(self.markup)
> File "/TPB/venv/lib/python2.7/site-packages/bs4/builder/_htmlparser.py", line 156, in feed
> raise e
>HTMLParser.HTMLParseError: bad end tag: u"", at line 337, column 5345