Scraping multiple items from a part of a page
I would like to scrape multiple items from part of a page
Simplified example:
Drinks:
Beer
Water
Juice
Food:
Hamburger
Fries
Chicken
I would like to select all the drinks from the page. The tables can contain up to a hundred items. Both tables are on the same page. The cells for both tables are identical. The only difference is the title of the section. If I select cells I get the food and the drinks. If I create a sub-extractor pattern I only get the first drink. Is there a way to define a part of a page and still extract multiple items?
Scraping multiple items from a part of a page
A_Hoogendam,
Not a bad approach. The other approach would be to look for key words from within a script and only perform the actions appropriate for the tables with the key words. Utilize one of the methods available for strings to identify key words.
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html
-Scott
Solution found
The answer is simple:
Scrape the drink table
Save table to temp file
Scrape tempfile
to make the data overwritable in the temp file change param to false:.txt", false );
out = new FileWriter( "