From ad52722cc6b55ce414d395e9a0860cee57c0ab2d Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Mon, 29 Nov 2021 22:13:33 -0500 Subject: Do a better job of keeping track of namespaces as an XML document is parsed, so that CSS selectors that use namespaces will do the right thing more often. [bug=1946243] --- doc/source/index.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'doc/source') diff --git a/doc/source/index.rst b/doc/source/index.rst index 67d3648..d81fccd 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -1800,9 +1800,9 @@ selectors.:: # [I'm in namespace 1] When handling a CSS selector that uses namespaces, Beautiful Soup -uses the namespace abbreviations it found when parsing the -document. You can override this by passing in your own dictionary of -abbreviations:: +always tries to use namespace prefixes that make sense based on what +it saw while parsing the document. You can always provide your own +dictionary of abbreviations:: namespaces = dict(first="http://namespace1/", second="http://namespace2/") soup.select("second|child", namespaces=namespaces) -- cgit v1.2.3