Search in sources :

Example 6 with Attributes

use of org.jsoup.nodes.Attributes in project jsoup by jhy.

the class AttributeParseTest method parsesEmptyString.

@Test
public void parsesEmptyString() {
    String html = "<a />";
    Element el = Jsoup.parse(html).getElementsByTag("a").get(0);
    Attributes attr = el.attributes();
    assertEquals(0, attr.size());
}
Also used : Element(org.jsoup.nodes.Element) Attributes(org.jsoup.nodes.Attributes) Test(org.junit.Test)

Aggregations

Attributes (org.jsoup.nodes.Attributes)6 Element (org.jsoup.nodes.Element)4 Test (org.junit.Test)3 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1 Set (java.util.Set)1 Attribute (org.jsoup.nodes.Attribute)1