diff options
author | Leonard Richardson <leonardr@segfault.org> | 2013-05-14 09:03:16 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2013-05-14 09:03:16 -0400 |
commit | b5aad803f01aabf1ef89d3d50d24efdbe157010a (patch) | |
tree | 80d846649cf5d58f40c49b95ba9aadd0f6f18651 /doc | |
parent | cab4e1708d6706d16ff31b25b2aef26e6ca15136 (diff) | |
download | beautifulsoup4-b5aad803f01aabf1ef89d3d50d24efdbe157010a.tar.gz |
Added warning about using NavigableString outside of Beautiful Soup.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/source/index.rst | 6 |
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`` ----------------- |