Skip to content

Add Ability to Limit the Number of Elements in Selector #92

@itboy87

Description

@itboy87

It would be useful to introduce a feature that allows the user to limit the number of elements returned by a selector. For cases where a user is only interested in a subset of elements (e.g., the first 10 matching elements), having an option to specify a limit would enhance performance and flexibility, especially when working with large datasets or documents.

Proposed API/Usage Example

val document = ksoup.parse(html)
val limitedElements = document.select("div.className", limit = 10) // Return only the first 10 matching elements

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions