0

I need to get all tables with some class, and get all id of rows with some class in this tables. My code is next:

HtmlPage page = webClient.getPage("http://www.somesite.com");
HtmlTable table = div.querySelector(".table-classname");
for (HtmlTableRow row : table.getRows())
{
String id = row.getAttribute("id");
System.out.println(id);
}

But it works only for first table on the page. How can i do this with all tables on the page?

intacto27
  • 9
  • 1

1 Answers1

1

You should probably use querySelectorAll instead of querySelector and iterate through the list of returned elements

maszter
  • 3,680
  • 6
  • 37
  • 53