ELEMENTS_BY_SELECTOR_QUERY(<string [containing HTML elements]>;<selector query>)
Returns all elements that match the selector query as a list.
For more information on selector queries, see jsoup.org
Download the example file: HTML_File_Example.html
Given the following excerpt from the HTML file:
The goal is to extract only the table data content that is located in the table body. Looking at the jsoup documentation on defining queries, a possible query to use is:
|ancestor child: child elements that descend from ancestor|
In this case, first extract the ancestor table body and then the child table data.
The results are the table data <td> elements that are located in the table body <tbody> tag.
|[<td>New York</td>, <td>San Francisco</td>, <td>Atlanta</td>, <td>Bread</td>, <td>Biscuits</td>, <td>Rolls</td>, <td>Sandwich</td>, <td>Soup</td>, <td>Salad</td>]|