-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
bugA confirmed bug, that we should fixA confirmed bug, that we should fixfixedAn {bug|improvement} that has been {fixed|implemented}An {bug|improvement} that has been {fixed|implemented}
Milestone
Description
Hi.
It seems nested :has() selectors not working.
String html =
"<html>" +
"<head></head>" +
"<body>" +
"<div>" +
"<div><span>hello</span></div>" +
"<div><span>world</span></div>" +
"</div>" +
"</body></html>";
Document document = Jsoup.parse(html);
System.out.println(document.select("div:has(> div:has(> span) + div:has(> span))").size());
System.out.println(document.select("div:has(> span) + div:has(> span)").stream().filter(v -> v.parent().is("div")).count());
Result:
0 // = unexpected
1 // = as expected
Metadata
Metadata
Assignees
Labels
bugA confirmed bug, that we should fixA confirmed bug, that we should fixfixedAn {bug|improvement} that has been {fixed|implemented}An {bug|improvement} that has been {fixed|implemented}