Browser4
Browser4 copied to clipboard
SelectHyperlinks serial methods do not support all <a> tag selection
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/]')
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")
...