我目前有以下HTML格式的数据:
Year| car type | # of cars sold
2001| Toyota-Camry | 242435
2000| Honda-Accord | 344423
2001| Honda-Accord | 555255
2000| Honda-Civic | 342344
2008| Toyota-Prius | 666154
1996| Honda-Accord | 114526
2001| Toyota-Prius | 90234
为了检索此数据,我有一个BufferedReader,它从HTML中读取行.由于存在空白,我在数据出现之前先跳过了几行.所以我的代码目前是
public class carSales {
private Map> carSalesMan =
new HashMap >;
private void getcarTypes(String url) {
try {
URL urlz = new URL(url);
URLConnection urlc = myURL.openConnection();
BufferedReader line = new BufferedReader
(new InputStreamReader(urlConnection.getInputStream()));
String next;
next = line.readLine();
while (next.contains("") {
String[] parts = next.split("