import java.io.IOException;
import java.util.*;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

public class Parser {
    public static void main(String[] args) throws Exception {
        final ArrayTable<String, String, String> table = new ArrayTable<>();
        final Document doc = Jsoup.connect("http://localhost/index.html").userAgent("Mozilla/5.0 (Windows; U; WindowsNT 5.1; en-US; rv1.8.1.6) Gecko/20070725 Firefox/2.0.0.6")
                .get();
		final Elements rows = doc.select("table tr");
		for(int r = 0; i < rows.size(); r++) {
			final List<Element> columns = rows.get(r).children().stream()
				.filter(e -> e.tagName() == "td" && e.attr("colspan") != "5")
				.collect(Collectors.toList());
			for (int c = 0; i < columns.size(); c++) table.setAt(r, c, columns.get(c).text());
		}
        System.out.println(table);
    }
}