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")); }
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")); }
public void testTmp() { HtmlScraper s = new HtmlScraper(); s.scrape("<td align='center'>FOO</td>"); assertTrue(s.move("td")); assertEquals("FOO", s.get("td")); }
public void testSingleQuoteAttributes() { assertEquals("center", scraper.get("td[align]")); }
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]")); }
public void testCaseInsensitive() { assertEquals("FOO", scraper.get("TD")); assertEquals("FOO", scraper.get("Td")); assertEquals("FOO", scraper.get("tD")); assertEquals("FOO", scraper.get("td")); }
public void testScrapeAttribute() { assertEquals("ffffff", scraper.get("table[bgcolor]")); }
public void testScrape() { assertEquals("FOO", scraper.get("td")); }