diff options
-rw-r--r-- | doc/source/index.rst | 10 |
1 files changed, 8 insertions, 2 deletions
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. <parser-installation>` 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. <parser-installation>` + ``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 |