我正在嘗試使用crawler4j,因爲它顯示在this示例中使用,無論我如何定義爬網程序的數量或更改根文件夾我繼續從代碼中獲取此錯誤:在crawler4j上確定參數
「所需要的參數: rootFolder(它將包含中間抓取數據) numberOfCralwers(併發線程)」 主要的代碼如下:
public class Controller {
public static void main(String[] args) throws Exception {
if (args.length != 2) {
System.out.println("Needed parameters: ");
System.out.println("\t rootFolder (it will contain intermediate crawl data)");
System.out.println("\t numberOfCralwers (number of concurrent threads)");
return;
}
/*
* crawlStorageFolder is a folder where intermediate crawl data is
* stored.
*/
String crawlStorageFolder = args[0];
/*
* numberOfCrawlers shows the number of concurrent threads that should
* be initiated for crawling.
*/
int numberOfCrawlers = Integer.parseInt(args[1]);
也有類似問題,問我想要什麼知道here,但我並不完全理解解決方案,就像我在那裏鍵入java BasicCrawler Controller「arg1」「arg2」。我在Eclipse上運行這個代碼,對於編程世界我還是相當新的。如果有人幫我理解這個問題,我會非常感激