You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

21 lines
819 B

import java.util.List;
public class StrategyCrawlerMain {
public static void main(String[] args) {
CrawlerContext context = new CrawlerContext(null);
System.out.println("=== Crawling DangDang ===");
context.setStrategy(new DangDangCrawlStrategy());
context.executeCrawlAndSave(1, 3, "strategy_crawler/dangdang_books.txt");
System.out.println("\n=== Crawling MaoYan ===");
context.setStrategy(new MaoYanCrawlStrategy());
context.executeCrawlAndSave(1, 1, "strategy_crawler/maoyan_movies.txt");
System.out.println("\n=== Crawling JD ===");
context.setStrategy(new JDCrawlStrategy());
context.executeCrawlAndSave(1, 3, "strategy_crawler/jd_products.txt");
System.out.println("\n=== All crawling tasks completed ===");
}
}