From 39da6ab6a1bd80799b82d133d74b2fc73800b1fe Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Fri, 30 Mar 2012 14:06:30 -0400 Subject: Mentioned the empty-list problem people often encounter. --- doc/source/index.rst | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'doc/source/index.rst') diff --git a/doc/source/index.rst b/doc/source/index.rst index 08e7336..5041e4e 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -2475,8 +2475,8 @@ thought I'd mention it:: Troubleshooting =============== -Common Errors -------------- +Common Problems +--------------- ``ImportError: No module named HTMLParser`` - Caused by running the Python 2 version of Beautiful Soup under Python 3. @@ -2497,6 +2497,12 @@ Python's built-in HTML parser a document it can't handle. :ref:`Install lxml or html5lib. ` Any other ``HTMLParseError`` is probably the same problem. +If you can't find a tag that you know is in the document (that is, +``find_all()`` returned `[]`` or ``find()`` returned ``None``), you're +probably using Python's built-in HTML parser, which sometimes skips +tags it doesn't understand. :ref:`Install lxml or +html5lib. ` + ``KeyError: [attr]`` - Caused by accessing ``tag['attr']`` when the tag in question doesn't define the ``attr`` attribute. The most common errors are ``KeyError: 'href'`` and ``KeyError: 'class'``. Use -- cgit v1.2.3