summaryrefslogtreecommitdiff
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
commit39da6ab6a1bd80799b82d133d74b2fc73800b1fe (patch)
tree77a8a9912c12e0b3978dced7c0957ba350bdf1d3
parente7e7b45da1824a8200eaf4c4700cf127fe514b34 (diff)
Mentioned the empty-list problem people often encounter.
-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