Skip to content

element fits gauge fails, if element is only allowed as children of a specific element #98

@DaniRey

Description

@DaniRey

Some elements, like tr or td are not allowed as direct children of body. They require table as their parent.

Imagine the document is

<html><head></head><body>
<table>
 <tr><td><img src="a.jpg"></img></td></tr>
 <tr><td><img src="b.jpg"></img></td></tr>
</body></html>

Then

val row = findAll(CssSelectorQuery("table>tr"))
for(row <- rows)
 row fits <tr><td><img src="@contains .jpg"></img></td></tr>
}

Will fail, because the outerHtml of every <tr> is parsed with Jsoup, which will remove <tr> if it is not within a <table>

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions