Examples of CrawlSpecification


Examples of com.crawljax.core.configuration.CrawlSpecification

  public static void main(String[] args) {
    if (args.length < 1) {
      System.err.println("Please give an url as first argument to Crawljax");
      System.exit(1);
    }
    CrawlSpecification crawler = new CrawlSpecification(args[0]);
    crawler.clickDefaultElements();

    CrawljaxConfiguration config = new CrawljaxConfiguration();

    config.setCrawlSpecification(crawler);
View Full Code Here

Examples of com.crawljax.core.configuration.CrawlSpecification

    tc.setNumberThreads(1);
    return tc;
  }

  private static CrawlSpecification getCrawlSpecification() {
    CrawlSpecification crawler = new CrawlSpecification(URL);

    // click these elements
    crawler.click("a");
    crawler.click("input").withAttribute("type", "submit");

    // except these
    crawler.dontClick("a").underXPath("//DIV[@id='guser']");
    crawler.dontClick("a").withText("Language Tools");

    crawler.setInputSpecification(getInputSpecification());

    // limit the crawling scope
    crawler.setMaximumStates(MAX_NUMBER_STATES);
    crawler.setDepth(MAX_DEPTH);

    return crawler;
  }
View Full Code Here

Examples of com.crawljax.core.configuration.CrawlSpecification

  private SiteSimpleExample() {
    // Utility class
  }

  private static CrawlSpecification getCrawlSpecification() {
    CrawlSpecification crawler = new CrawlSpecification(URL);

    crawler.clickDefaultElements();
    crawler.dontClick(ALL_ANCHORS).underXPath(HEADER_XPATH);
    crawler.dontClick(ALL_ANCHORS).withText(LANGUAGE_TOOLS);

    // limit the crawling scope
    crawler.setMaximumStates(MAX_STATES);
    crawler.setDepth(MAX_CRAWL_DEPTH);

    crawler.setInputSpecification(getInputSpecification());

    // Make sure we only crawl Google and no external web site
    crawler.addCrawlCondition("Only crawl Google", new UrlCondition("google"));

    return crawler;
  }
View Full Code Here

Examples of com.crawljax.core.configuration.CrawlSpecification

    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;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.