In crawler4j we can override a function boolean shouldVisit(WebUrl url)
and control whether that particular url should be allowed to be crawled by returning 'true' and 'false'.
But can we add URL(s) at runtime ? if yes , what are ways to do that ?
Currently I can add URL(s) at beginning of program using addSeed(String url)
function before the start(BasicCrawler.class, numberOfCrawlers)
in CrawlController
class and if I try to add new url using addSeed(String url)
, it gives error. Here is error image .
Any help will be appreciative and please let me know if any more detail about project is required to answer the question .