简体   繁体   中英

Crawler4j with Grails App throws error

This might be a very basic and silly question for experienced people. But please help. I am trying to use Crawler4j with in my Grails app by following this tutorial. I know its Java code but I am using it in a controller class called CrawlerController.groovy.

I added the jar files but when I write CrawlConfig crawlConfig = new CrawlConfig() it throws me a compiler error saying "Groovy unable to resolve class" . I refreshed dependencies and tried everything. May be I am missing something since I am a beginner. This is what I have written so far and all the import statements and CrawlConfig statement throws errors:

import edu.uci.ics.crawler4j.crawler.Page;
import edu.uci.ics.crawler4j.crawler.WebCrawler;
import edu.uci.ics.crawler4j.parser.HtmlParseData;
import edu.uci.ics.crawler4j.url.WebURL;
class CrawlerController extends WebCrawler {
    public static void main(String[] args) {
    CrawlConfig crawlConfig = new CrawlConfig()

    }
}

` Please help. Thanks.

只需刷新您的依赖项即可。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM