summaryrefslogtreecommitdiff
path: root/doc/source/index.rst
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2012-03-30 08:58:59 -0400
committerLeonard Richardson <leonard.richardson@canonical.com>2012-03-30 08:58:59 -0400
commite7e7b45da1824a8200eaf4c4700cf127fe514b34 (patch)
treebe67f5ac1c59ffe5374749a431e3c3d6e91ba599 /doc/source/index.rst
parent0d0771a3b98c3d157eac4bfc1c46a6598f871e27 (diff)
Added a section to the documentation on common errors.
Diffstat (limited to 'doc/source/index.rst')
-rw-r--r--doc/source/index.rst28
1 files changed, 28 insertions, 0 deletions
diff --git a/doc/source/index.rst b/doc/source/index.rst
index c5eb6ac..08e7336 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -2475,6 +2475,34 @@ thought I'd mention it::
Troubleshooting
===============
+Common Errors
+-------------
+
+``ImportError: No module named HTMLParser`` - Caused by running the
+Python 2 version of Beautiful Soup under Python 3.
+
+``ImportError: No module named html.parser`` - Caused by running the
+Python 3 version of Beautiful Soup under Python 2.
+
+``ImportError: No module named BeautifulSoup`` - Caused by running
+Beautiful Soup 3 code on a system that doesn't have BS3 installed. Or,
+by writing Beautiful Soup 4 code without knowing that the package name
+has changed to ``bs4``.
+
+``ImportError: No module named bs4`` - Caused by running Beautiful
+Soup 4 code on a system that doesn't have BS4 installed.
+
+``HTMLParser.HTMLParseError: malformed start tag`` - Caused by giving
+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.
+
+``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
+``tag.get('attr')`` if you're not sure ``attr`` is defined, just as
+you would with a Python dictionary.
+
Parsing XML
-----------