You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
org.jsoup.select.Selector$SelectorParseException: Could not parse query 'section.event-list.grid.md:grid-cols-2.lg:grid-cols-3.gap-8.md:gap-12.lg:gap-16.lg:block': unexpected token at ':grid-cols-2.lg:grid-cols-3.gap-8.md:gap-12.lg:gap-16.lg:block'
at org.jsoup.select.QueryParser.findElements(QueryParser.java:218)
at org.jsoup.select.QueryParser.parse(QueryParser.java:74)
at org.jsoup.select.QueryParser.parse(QueryParser.java:45)
at org.jsoup.select.QueryParser.combinator(QueryParser.java:90)
at org.jsoup.select.QueryParser.parse(QueryParser.java:60)
at org.jsoup.select.QueryParser.parse(QueryParser.java:45)
at org.jsoup.select.Selector.select(Selector.java:95)
at org.jsoup.nodes.Element.select(Element.java:421)
at org.jsoup.nodes.Element.cssSelector(Element.java:838)
Seems that jsoup cannot parse it's own generated query.
Using jsoup 1.14.3
The text was updated successfully, but these errors were encountered:
I don't have the html-example anymore. But it seems, that the html contains some classes like "grid.md:grid-cols-2", so it must look like <section class="grid.md:grid-cols-2 lg:grid-cols-3">.. maybe it is invalid html/css, but jsoup should not crash, with its own document-model.
There is no input query, because jsoup generated its own query (Element.cssSelector method)
jhy
added
bug
Confirmed bug that we should fix
and removed
needs-more-info
More information is needed from the reporter to progress the issue
labels
Jan 6, 2023
jhy
changed the title
Element.cssSelector() fails with org.jsoup.select.Selector$SelectorParseException: Could not parse query
Element.cssSelector() generates invalid queries if the class or ID is invalid; needs escaping
Jan 6, 2023
This can be fixed by implementing escapes in the query parser for IDs and classes (etc). E.g. an updated / revised #1442. And then apply the escapes in the cssSelector method.
Seems that jsoup cannot parse it's own generated query.
Using jsoup 1.14.3
The text was updated successfully, but these errors were encountered: