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>
Some elements, like
trortdare not allowed as direct children ofbody. They requiretableas their parent.Imagine the document is
Then
Will fail, because the outerHtml of every
<tr>is parsed with Jsoup, which will remove<tr>if it is not within a<table>