Esempio n. 1
0
 @Test
 public void testByAttributeRegexCombined() {
   Document doc = Jsoup.parse("<div><table class=x><td>Hello</td></table></div>");
   Elements els = doc.select("div table[class~=x|y]");
   assertEquals(1, els.size());
   assertEquals("Hello", els.text());
 }
Esempio n. 2
0
 @Test
 public void testCombinedWithContains() {
   Document doc = Jsoup.parse("<p id=1>One</p><p>Two +</p><p>Three +</p>");
   Elements els = doc.select("p#1 + :contains(+)");
   assertEquals(1, els.size());
   assertEquals("Two +", els.text());
   assertEquals("p", els.first().tagName());
 }