Hallo,
ich hab mir eine kleine Methode geschrieben, um alle table zu “extrahieren”:
List<?> l = e.getByXPath(path[index]);
for (Object object : l) {
HtmlElement he = (HtmlElement) object;
System.out.println(before[index]);
if (index < path.length - 1) {
find(he, path, index + 1, before, after);
} else {
System.out.println(he.asText() );
}
System.out.println(after[index]);
}
}```
und aufgerufen wird sie so:
``` find(
hp,
new String[]{".//table", ".//tbody/tr", ".//td"},
0,
new String[]{"<p><table>", "<tr>", "<td>"},
new String[]{"</table></p>", "</tr>", "</td>"});```
Jetzt sagt er mir aber:
> No "p" element in scope but a "p" end tag seen.
> From line 4507, column 9; to line 4507, column 12
> (Rule Category: Elements structure)
Was mach ich falsch, bzw., würdet ihr auch so machen?