jsoup icon indicating copy to clipboard operation
jsoup copied to clipboard

Add select methods returning element streams

Open Isira-Seneviratne opened this issue 2 years ago • 2 comments

Isira-Seneviratne avatar Dec 28 '23 07:12 Isira-Seneviratne

I liked the original PR but I don't think I'm a fan of the changes in e1e35bb627ae25130e2b7df505580061f6bf8284 - all the getElementsStream methods. Generally the getElementBy... methods are only there to help users get used to jsoup coming from APIs like the W3C DOM APIs. They are not as powerful as the select methods. And extending them for direct stream access feels like its adding a bit of clutter for little value.

I think the selectStream(query) and selectStream(evaluator) should cover the core use case of this.

Also I think the test is still pretty anemic as it only selects one element. Doesn't test conditions where there's more or less results, or the order, etc. Would be great if you could beef those up.

jhy avatar Jul 30 '24 11:07 jhy

Fair enough. I'll undo the newer changes.

Also, I was planning to add more tests, should've marked this PR as draft.

Isira-Seneviratne avatar Aug 01 '24 05:08 Isira-Seneviratne