config.setCrawlSpecification(getCrawlSpecification());
return config;
}
private static CrawlSpecification getCrawlSpecification() {
CrawlSpecification crawler = new CrawlSpecification(URL);
// click these elements
crawler.clickDefaultElements();
crawler.click("div").withAttribute("class", "clickable");
// but don't click these
crawler.dontClick("a").withAttribute("class", "ignore");
crawler.dontClick("a").underXPath("//DIV[@id='footer']");
crawler.setWaitTimeAfterReloadUrl(WAIT_TIME_AFTER_RELOAD);
crawler.setWaitTimeAfterEvent(WAIT_TIME_AFTER_EVENT);
crawler.setInputSpecification(getInputSpecification());
crawler.addCrawlCondition("No spans with foo as class", new NotXPathCondition(
"//*[@class='foo']"));
return crawler;
}