Package com.gistlabs.mechanize.document.link

Examples of com.gistlabs.mechanize.document.link.Links.find()


    AbstractDocument page = agent.get("http://www.wikipedia.org");
    assertNotNull(page);
    assertTrue(page.size() > 10000);
    Links links = page.links();
    assertTrue(links.size() > 10);
    assertNotNull(links.find("*[title*='English']"));
  }

  @Test
  public void testClickingEnglishWikipediaVersionLink() {
    Mechanize agent = new MechanizeAgent();
View Full Code Here


    AbstractDocument page = agent.get("http://www.wikipedia.org");
    assertNotNull(page);
    assertTrue(page.size() > 10000);
    Links links = page.links();
    assertTrue(links.size() > 10);
    Link link = links.find("*[title*='English']");
    assertNotNull(link);
    Resource englishPage = link.click();
    assertEquals("Wikipedia, the free encyclopedia", englishPage.getTitle());
  }

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.