Skip to content

Instantly share code, notes, and snippets.

@kylewm
Created April 23, 2015 22:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kylewm/89fe76aeb6e32af8146b to your computer and use it in GitHub Desktop.
Save kylewm/89fe76aeb6e32af8146b to your computer and use it in GitHub Desktop.
html5lib bug
>>> from bs4 import BeautifulSoup
>>> import requests
>>> soup = BeautifulSoup(requests.get('https://snarfed.org/2015-04-18_kyle-mahan-checked-in-to-nourse-theatre').text)
>>> soup.body.div.find_all()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/srv/www/kylewm.com/redwind/venv/lib/python3.4/site-packages/bs4/element.py", line 1180, in find_all
return self._find_all(name, attrs, text, limit, generator, **kwargs)
File "/srv/www/kylewm.com/redwind/venv/lib/python3.4/site-packages/bs4/element.py", line 491, in _find_all
return ResultSet(strainer, result)
File "/srv/www/kylewm.com/redwind/venv/lib/python3.4/site-packages/bs4/element.py", line 1610, in __init__
super(ResultSet, self).__init__(result)
File "/srv/www/kylewm.com/redwind/venv/lib/python3.4/site-packages/bs4/element.py", line 489, in <genexpr>
result = (element for element in generator
File "/srv/www/kylewm.com/redwind/venv/lib/python3.4/site-packages/bs4/element.py", line 1198, in descendants
current = current.next_element
AttributeError: 'NoneType' object has no attribute 'next_element'
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment