MCPcopy Create free account
hub / github.com/jhy/jsoup / hasAttr

Method hasAttr

src/test/java/org/jsoup/select/ElementsTest.java:53–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

51 }
52
53 @Test public void hasAttr() {
54 Document doc = Jsoup.parse("<p title=foo><p title=bar><p class=foo><p class=bar>");
55 Elements ps = doc.select("p");
56 assertTrue(ps.hasAttr("class"));
57 assertFalse(ps.hasAttr("style"));
58 }
59
60 @Test public void hasAbsAttr() {
61 Document doc = Jsoup.parse("<a id=1 href='/foo'>One</a> <a id=2 href='https://jsoup.org'>Two</a>");

Callers 12

trackSeenMethod · 0.45
declarationsMethod · 0.45
leafNodeAttributesMethod · 0.45
trackSeenMethod · 0.45
handlesAbsPrefixMethod · 0.45
literalAbsPrefixMethod · 0.45
testGroupOrMethod · 0.45

Calls 3

parseMethod · 0.95
hasAttrMethod · 0.95
selectMethod · 0.45

Tested by

no test coverage detected