16 hours ago
selenium

Nightly

Commits

  • 379f828: [java][BiDi] implement browsingContext.historyUpdated (#15901) (Swastik Baranwal) #15901
  • 47af349: [java][refactor] Remove Empty Space in CommandPayload (#15934) (Bradley Latreille) #15934
  • f375257: [FEAT] Add macOS-specific keys (OPTION, FN) to Keys enum for improved… (#15910) (Manuel Blanco) #15910
  • 0aa4ac1: Clarify development steps in contribution guidelines (#15937) (Corey Goldberg) #15937
  • 21b07d5: [java][BiDi] implement web extensions (#15660) (Swastik Baranwal) #15660
  • 093fd7f: [java] Made JsonToWebElementConverter methods/fields protected (#15885) (Alex B) #15885
  • c91ebdf: [py] Adding Note to enable_webextensions() regarding CDP (plus gen docstring updates) (#15927) (Simon Benzer) #15927
  • 0ab16b4: [js] Update dependency ws to ^8.18.2 (#15780) (renovate[bot]) #15780
  • 7d8e7e9: [js] Update dependency sinon to ^19.0.5 (#15771) (renovate[bot]) #15771
  • 507b007: [js] Update dependency multer to v1.4.5-lts.2 (#15770) (renovate[bot]) #15770
  • e1cb6a5: [grid] Session can be deleted via Grid UI (#15808) (Viet Nguyen Duc) #15808
  • 3876882: [java] Feat 14291/jspecify nullable annotation (#15924) (Alex Popov) #15924
1 days ago
jsoup

jsoup 1.21.1

jsoup 1.21.1 is out now, featuring powerful new node selection capabilities that let you target specific DOM nodes like comments and text nodes using CSS selectors, dynamic tag customization through the new TagSet callback system, and improved defense against mutation XSS attacks with simplified attribute escaping. This release also brings HTTP/2 support by default, numerous API improvements for better developer experience, and fixes for several edge-case parsing issues.

jsoup is a Java library for working with real-world HTML and XML. It provides a very convenient API for extracting and manipulating data, using the best of HTML5 DOM methods and CSS selectors.

Changes

  • Removed previously deprecated methods. #2317
  • Deprecated the :matchText pseduo-selector due to its side effects on the DOM; use the new ::textnode selector and the Element#selectNodes(String css, Class<T> type) method instead. #2343
  • Deprecated Connection.Response#bufferUp() in lieu of Connection.Response#readFully() which can throw a checked IOException.
  • Deprecated internal methods Validate#ensureNotNull(Object) (replaced by typed Validate#expectNotNull(T)); protected HTML appenders from Attribute and Node.
  • If you happen to be using any of the deprecated methods, please take the opportunity now to migrate away from them, as they will be removed in a future release.

Improvements

  • Enhanced the Selector to support direct matching against nodes such as comments and text nodes. For example, you can now find an element that follows a specific comment: ::comment:contains(prices) + p will select p elements immediately after a <!-- prices: --> comment. Supported types include ::node, ::leafnode, ::comment, ::text, ::data, and ::cdata. Node contextual selectors like ::node:contains(text), :matches(regex), and :blank are also supported. Introduced Element#selectNodes(String css) and Element#selectNodes(String css, Class<T> nodeType) for direct node selection. #2324
  • Added TagSet#onNewTag(Consumer<Tag> customizer): register a callback that’s invoked for each new or cloned Tag when it’s inserted into the set. Enables dynamic tweaks of tag options (for example, marking all custom tags as self-closing, or everything in a given namespace as preserving whitespace). #2330
  • Made TokenQueue and CharacterReader autocloseable, to ensure that they will release their buffers back to the buffer pool, for later reuse.
  • Added Selector#evaluatorOf(String css), as a clearer way to obtain an Evaluator from a CSS query. An alias of QueryParser.parse(String css).
  • Custom tags (defined via the TagSet) in a foreign namespace (e.g. SVG) can be configured to parse as data tags.
  • Added NodeVisitor#traverse(Node) to simplify node traversal calls (vs. importing NodeTraversor).
  • Updated the default user-agent string to improve compatibility. #2341
  • The HTML parser now allows the specific text-data type (Data, RcData) to be customized for known tags. (Previously, that was only supported on custom tags.) #2326
  • Added Connection.Response#readFully() as a replacement for Connection.Response#bufferUp() with an explicit IOException. Similarly, added Connection.Response#readBody() over Connection.Response#body(). Deprecated Connection.Response#bufferUp(). #2327
  • When serializing HTML, the < and > characters are now escaped in attributes. This helps prevent a class of mutation XSS attacks. #2337
  • Changed Connection to prefer using the JDK's HttpClient over HttpUrlConnection, if available, to enable HTTP/2 support by default. Users can disable via -Djsoup.useHttpClient=false. #2340

Bug Fixes

  • The contents of a script in a svg foreign context should be parsed as script data, not text. #2320
  • Tag#isFormSubmittable() was updating the Tag's options. #2323
  • The HTML pretty-printer would incorrectly trim whitespace when text followed an inline element in a block element. #2325
  • Custom tags with hyphens or other non-letter characters in their names now work correctly as Data or RcData tags. Their closing tags are now tokenized properly. #2332
  • When cloning an Element, the clone would retain the source's cached child Element list (if any), which could lead to incorrect results when modifying the clone's child elements. #2334