summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2012-03-30 14:06:30 -0400
committerLeonard Richardson <leonard.richardson@canonical.com>2012-03-30 14:06:30 -0400
commitd2912c56f40ed61b23d34827e4dddacff41e6c59 (patch)
treedc89a1c38dd81cfa829a7a0b08eb6162fd4c80f9 /doc
parent8a25c86892f6d0a7416271e6a1c7cf17e1265507 (diff)
downloadbeautifulsoup4-d2912c56f40ed61b23d34827e4dddacff41e6c59.tar.gz
Mentioned the empty-list problem people often encounter.
Diffstat (limited to 'doc')
-rw-r--r--doc/source/index.rst10
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