Beautiful Soup 4.12.0

36 views
Skip to first unread message

leonardr

unread,
Mar 20, 2023, 8:12:22 AM3/20/23
to beautifulsoup
This is a feature release that makes it much easier to access Soup Sieve functionality through Beautiful Soup. The documentation has also been reorganized to make it possible to cross-reference Beautiful Soup classes using intersphinx.

Full changelog:

= 4.12.0 (20230320)

* Introduced the .css property, which centralizes all access to
  the Soup Sieve API. This allows Beautiful Soup to give direct
  access to as much of Soup Sieve that makes sense, without cluttering
  the BeautifulSoup and Tag classes with a lot of new methods.

  This does mean one addition to the BeautifulSoup and Tag classes
  (the .css property itself), so this might be a breaking change if you
  happen to use Beautiful Soup to parse XML that includes a tag called
  <css>. In particular, code like this will stop working in 4.12.0:

    soup.css['id']

  Code like this will work just as before:

    soup.find_one('css')['id']

  The Soup Sieve methods supported through the .css property are
  select(), select_one(), iselect(), closest(), match(), filter(),
  escape(), and compile(). The BeautifulSoup and Tag classes still
  support the select() and select_one() methods; they have not been
  deprecated, but they have been demoted to convenience methods.

  [bug=2003677]

* When the html.parser parser decides it can't parse a document, Beautiful
  Soup now consistently propagates this fact by raising a
  ParserRejectedMarkup error. [bug=2007343]

* Removed some error checking code from diagnose(), which is redundant with
  similar (but more Pythonic) code in the BeautifulSoup constructor.
  [bug=2007344]

* Added intersphinx references to the documentation so that other
  projects have a target to point to when they reference Beautiful
  Soup classes. [bug=1453370]


Reply all
Reply to author
Forward
0 new messages