summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2013-05-14 09:03:16 -0400
committerLeonard Richardson <leonardr@segfault.org>2013-05-14 09:03:16 -0400
commitef34d42104b7b207527c4b808855aba40a2263d3 (patch)
tree66bbf41ab3b01ce4a30bbd256e9799042ae06c78
parent2738a3bb506ba3b87aa19fcc2846594e279f4dd3 (diff)
Added warning about using NavigableString outside of Beautiful Soup.
-rw-r--r--doc/source/index.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/source/index.rst b/doc/source/index.rst
index b1cbd21..073fff3 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -455,6 +455,12 @@ them. In particular, since a string can't contain anything (the way a
tag may contain a string or another tag), strings don't support the
``.contents`` or ``.string`` attributes, or the ``find()`` method.
+If you want to use a ``NavigableString`` outside of Beautiful Soup,
+you should call ``unicode()`` on it to turn it into a normal Python
+Unicode string. If you don't, your string will carry around a
+reference to the entire Beautiful Soup parse tree, even when you're
+done using Beautiful Soup. This is a big waste of memory.
+
``BeautifulSoup``
-----------------