CrawlerConfiguration configuration = new CrawlerConfiguration();
// Creating five crawlers (to work with 5 threads)
for (int i = 0; i < 5; i++) {
// Creating crawler and setting downloader and parser controllers
DefaultCrawler crawler = new ExampleCrawler();
crawler.setDownloaderController(downloaderController);
crawler.setParserController(parserController);
// Adding crawler to the configuration object
configuration.addCrawler(crawler);
}
// Setting maximum parallel requests to a single site limit