Browser4 icon indicating copy to clipboard operation
Browser4 copied to clipboard

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

Open platonai opened this issue 1 year ago • 1 comments

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 avatar Mar 19 '24 12:03 platonai

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")
...

platonai avatar Mar 19 '24 12:03 platonai