summaryrefslogtreecommitdiff
path: root/doc/source
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2012-04-11 18:51:48 -0400
committerLeonard Richardson <leonard.richardson@canonical.com>2012-04-11 18:51:48 -0400
commit69a40882e7dcbee8cca9ad17a43c4488601f7f82 (patch)
treed569ee1d1e8dfe67af69c99dc288e0494de5cc41 /doc/source
parent03d01d1d1910510c8340daf4e21a556b31ae4804 (diff)
Added renderContents back.
Diffstat (limited to 'doc/source')
-rw-r--r--doc/source/index.rst16
1 files changed, 13 insertions, 3 deletions
diff --git a/doc/source/index.rst b/doc/source/index.rst
index 0b85924..5016fb0 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -2201,9 +2201,9 @@ that are part of the HTML5 standard, so it has the best claim on being
the "correct" way, but all three techniques are legitimate.
Differences between parsers can affect your script. If you're planning
-on distributing your script to other people, you might want to specify
-in the ``BeautifulSoup`` constructor which parser you used during
-development. That will reduce the chances that your users parse a
+on distributing your script to other people, or running it on multiple
+machines, you should specify a parser in the ``BeautifulSoup``
+constructor. That will reduce the chances that your users parse a
document differently from the way you parse it.
Encodings
@@ -2503,12 +2503,21 @@ probably using Python's built-in HTML parser, which sometimes skips
tags it doesn't understand. Solution: :ref:`Install lxml or
html5lib. <parser-installation>`
+If your script works on one computer but not another, it's probably
+because the two computers have different sets of parser libraries
+available. For instance, you may have developed the script on a
+computer that has lxml installed, and then tried to run it on a
+computer that only has html5lib installed. See `Differences between
+parsers`_ for why this matters, and fix the problem by mentioning a
+specific parser library in the ``BeautifulSoup`` constructor.
+
``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
-----------
@@ -2616,6 +2625,7 @@ use that instead. See `Installing a parser`_ for a comparison.
Method names
^^^^^^^^^^^^
+* ``renderContents`` -> ``encode_contents``
* ``replaceWith`` -> ``replace_with``
* ``replaceWithChildren`` -> ``replace_with_children``
* ``findAll`` -> ``find_all``