Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SelectHyperlinks serial methods do not support all <a> tag selection #59

Open
platonai opened this issue Mar 19, 2024 · 1 comment
Open

Comments

@platonai
Copy link
Owner

The following queries are failed:

document.selectHyperlinks('[href=/dp/]')
ele.selectHyperlinks('[href=/dp/]')

the following queiries are supported by chrome devtools, bug not sure they are standard or not, they are also failed:

document.selectHyperlinks('[href*=/dp/]')
ele.selectHyperlinks('[href*=/dp/]')

@platonai
Copy link
Owner Author

The cause is that selectHyperlinks append a selector automatically if the query does not contains one.

fun Node.selectHyperlinks(query: String, offset: Int = 1, limit: Int = Int.MAX_VALUE): List<Hyperlink> {
    val cssQuery = appendSelectorIfMissing(query, "a")
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant