Here you can find the source of parseTable2ArrayList(Document doc, String selectorRow, String selectorCol)
Parameter | Description |
---|
public static ArrayList<String[]> parseTable2ArrayList(Document doc, String selectorRow, String selectorCol)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; public class Main { public static ArrayList<String[]> parseTable2ArrayList(Document doc, String selectorRow, String selectorCol) { Elements rows = doc.select(selectorRow); ArrayList<String[]> arrayList = new ArrayList<String[]>(); for (Element row : rows) { Elements cols = row.select(selectorCol); String[] array = new String[cols.size()]; for (int i = 0; i < cols.size(); i++) { array[i] = cols.get(i).html(); }/*from w w w .j a va 2s . c o m*/ arrayList.add(array); } return arrayList; } }