diff options
author | Zhiming Wang <zmwangx@gmail.com> | 2015-07-05 23:35:08 -0700 |
---|---|---|
committer | Zhiming Wang <zmwangx@gmail.com> | 2015-07-05 23:35:08 -0700 |
commit | 8eeba026961719e5123195d354dacf75938dff62 (patch) | |
tree | 5c6437e36f1a4dd33d14f174de899d16bcef5025 /source/img/icon-2048.png | |
parent | a3a4bfee3d1acf00fc35e9f48738d7e6adce6ca0 (diff) | |
download | my_new_personal_website-8eeba026961719e5123195d354dacf75938dff62.tar.xz my_new_personal_website-8eeba026961719e5123195d354dacf75938dff62.zip |
fixes for beautifulsoup4 4.4.0
* Explicitly specify the lxml parser to suppress warnings;
* Supposedly fix the
AttributeError: 'NoneType' object has no attribute 'next_element'
issue [1] with BeautifulSoup when finding elements after extracting
certain tags. I bet I've encountered that error before, but it seemed
to went away somehow. Not this time. Without digging into to much
detail (don't have time to file a bug or anything), this fix --
precompile a list of tags to extract, and only extract after done with
other processing -- seem to work.
* Add .nojekyll to root of build
dir (https://help.github.com/articles/files-that-start-with-an-underscore-are-missing/).
[1]: Full traceback:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-7-9d3d20b34e0c> in <module>()
----> 1 a.footer
/Users/zmwang/.pyenv/versions/3.4.3/lib/python3.4/site-packages/beautifulsoup4-4.4.0-py3.4.egg/bs4/element.py in __getattr__(self, tag)
995 # We special case contents to avoid recursion.
996 elif not tag.startswith("__") and not tag=="contents":
--> 997 return self.find(tag)
998 raise AttributeError(
999 "'%s' object has no attribute '%s'" % (self.__class__, tag))
/Users/zmwang/.pyenv/versions/3.4.3/lib/python3.4/site-packages/beautifulsoup4-4.4.0-py3.4.egg/bs4/element.py in find(self, name, attrs, recursive, text, **kwargs)
1232 criteria."""
1233 r = None
-> 1234 l = self.find_all(name, attrs, recursive, text, 1, **kwargs)
1235 if l:
1236 r = l[0]
/Users/zmwang/.pyenv/versions/3.4.3/lib/python3.4/site-packages/beautifulsoup4-4.4.0-py3.4.egg/bs4/element.py in find_all(self, name, attrs, recursive, text, limit, **kwargs)
1253 if not recursive:
1254 generator = self.children
-> 1255 return self._find_all(name, attrs, text, limit, generator, **kwargs)
1256 findAll = find_all # BS3
1257 findChildren = find_all # BS2
/Users/zmwang/.pyenv/versions/3.4.3/lib/python3.4/site-packages/beautifulsoup4-4.4.0-py3.4.egg/bs4/element.py in _find_all(self, name, attrs, text, limit, generator, **kwargs)
527 while True:
528 try:
--> 529 i = next(generator)
530 except StopIteration:
531 break
/Users/zmwang/.pyenv/versions/3.4.3/lib/python3.4/site-packages/beautifulsoup4-4.4.0-py3.4.egg/bs4/element.py in descendants(self)
1271 while current is not stopNode:
1272 yield current
-> 1273 current = current.next_element
1274
1275 # CSS selector code
AttributeError: 'NoneType' object has no attribute 'next_element'
Diffstat (limited to 'source/img/icon-2048.png')
0 files changed, 0 insertions, 0 deletions