Пример #1
0
 public void testScrapeTableCell() {
   scraper.move("tr");
   String t = scraper.get("tr");
   HtmlScraper scraper2 = new HtmlScraper();
   scraper2.scrape(t);
   //        HtmlScraper scraper2 = scraper.scrapeTag("tr");
   assertEquals("<td align='center'>FOO</td>", scraper2.toString());
   assertTrue(scraper2.move("td"));
   assertEquals("FOO", scraper2.get("td"));
 }
Пример #2
0
  public void testMove() {
    assertTrue(scraper.move("td"));
    assertEquals("FOO", scraper.get("td"));
    assertFalse(scraper.move("td"));

    scraper.scrape(TEST_PAGE + TEST_PAGE);
    assertTrue(scraper.move("td"));
    assertEquals("FOO", scraper.get("td"));
    assertTrue(scraper.move("td"));
    assertEquals("FOO", scraper.get("td"));
    assertFalse(scraper.move("td"));
  }
Пример #3
0
 public void testTmp() {
   HtmlScraper s = new HtmlScraper();
   s.scrape("<td align='center'>FOO</td>");
   assertTrue(s.move("td"));
   assertEquals("FOO", s.get("td"));
 }
Пример #4
0
 public void testSingleQuoteAttributes() {
   assertEquals("center", scraper.get("td[align]"));
 }
Пример #5
0
 public void testCaseInsensitiveAttribute() {
   assertEquals("ffffff", scraper.get("TABLE[bgcolor]"));
   assertEquals("ffffff", scraper.get("TABLE[BGCOLOR]"));
   assertEquals("ffffff", scraper.get("table[BGCOLOR]"));
   assertEquals("ffffff", scraper.get("table[bgcolor]"));
 }
Пример #6
0
 public void testCaseInsensitive() {
   assertEquals("FOO", scraper.get("TD"));
   assertEquals("FOO", scraper.get("Td"));
   assertEquals("FOO", scraper.get("tD"));
   assertEquals("FOO", scraper.get("td"));
 }
Пример #7
0
 public void testScrapeAttribute() {
   assertEquals("ffffff", scraper.get("table[bgcolor]"));
 }
Пример #8
0
 public void testScrape() {
   assertEquals("FOO", scraper.get("td"));
 }