You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FR: selectFirst() and expectFirst() on org.jsoup.select.Elements #2256
It'd be useful to be able to use selectFirst() and expectFirst() on org.jsoup.select.Elements instances to mirror the methods in org.jsoup.nodes.Element.
As far as I understand this is because org.jsoup.select.Selector provides both select(String, Element) and select(String, Iterable<Element>) but only selectFirst(String, Element).
I could take a look at it myself, but people knowledgeable about jsoup internals would probably take much less time.
Bonus points if it's actually faster than select(...).first() 😉
@midgleyc has implemented this. And yes, like Element.selectFirst(), it does short-circuit on the first hit, so will be faster than `Elements.select(...).first().
Activity
jhy commentedon Jan 4, 2025
Thanks, sounds like a good idea.
jhy commentedon Jan 24, 2025
@midgleyc has implemented this. And yes, like
Element.selectFirst(), it does short-circuit on the first hit, so will be faster than `Elements.select(...).first().PrOF-kk commentedon Jan 27, 2025
Thanks!