Closed DaniRey closed 5 years ago
Some elements, like tr or td are not allowed as direct children of body. They require table as their parent.
tr
td
body
table
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>
<tr>
<table>
Some elements, like
tr
ortd
are not allowed as direct children ofbody
. They requiretable
as 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>