*/
private static CrawljaxConfiguration getConfig() {
CrawljaxConfiguration config = new CrawljaxConfiguration();
config.setBrowser(BrowserType.firefox);
CrawlSpecification crawler = new CrawlSpecification("http://www.google.com");
crawler.setWaitTimeAfterEvent(500);
crawler.setWaitTimeAfterReloadUrl(500);
// click on all anchor tags
crawler.click("a");
// and all input tags with "submit"
crawler.click("input").withAttribute("type", "submit");
// exclude these
crawler.dontClick("a").underXPath("//DIV[@id='guser']");
crawler.dontClick("a").withText("Language Tools");
InputSpecification inputSpec = new InputSpecification();
inputSpec.field("q").setValue("Crawljax");
crawler.setInputSpecification(inputSpec);
// Constrain the crawl to Google (no other web sites)
crawler.addCrawlCondition("Only crawl Google", new UrlCondition("google"));
// limit the crawling scope
crawler.setMaximumStates(6);
crawler.setDepth(2);
config.setCrawlSpecification(crawler);
return config;
}