Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以将参数传递给 WebCrawler ?例如,我想WebCrawler.shouldVisit(WebURL url)在运行时为方法传递新规则或在我的 WebCrawler 中设置一些字段。可能吗?
WebCrawler.shouldVisit(WebURL url)
我找到了答案。您可以使用方法 CrawlController.setCustomData(Object customData) 来存储数据,然后可以使用 WebCrawler.getMyController().getCustomData() 从爬虫中获取数据。