⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test.java

📁 Light in the box 抓取程序。 使用HttpClient
💻 JAVA
字号:
package com.blogool.export;

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

import com.blogool.crawl.Util;
import com.blogool.crawl.lib.*;

public class Test {
	public static void main(String[] args) throws Exception {
		Cat root = Util.loadCat(new File("d:/libox1/cats4.xml"));
		
		for (int i = 0; i < root.getCats().size(); i ++) {
			Cat c = root.getCats().get(i);
			for (int j = 0; j < c.getCats().size(); j ++) {
				Cat cat = c.getCats().get(j);
				List<Item> list = cat.getItems();
				if (list == null) continue;
				for (int k = 0; k < list.size(); k ++) {
					Item item = list.get(k);
					System.out.println(item.getProductName());
				}
				
			}
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -