Element 객체가 할 수 있는 작업 입니다.
* attr(String key) 로 속성의 값을 얻습니다. attr(String key, String value)로 속성의 값을 설정할 수 있습니다.
* id(), className() 은 id와 class속성의 값을 가져옵니다. class는 여러개 지정되면 하나의 문자열로 반환됩니다. 예로 요소가 <div class="center red">
라면 className() 은 “center red” 를 반환합니다. 하나씩 구하기 위해서는 classNames() 메소드를 사용합니다. Set<String>
타입으로 반환합니다.
* text()로 순수 텍스트만 구합니다. text(String value)로 요소의 텍스트를 설정할 수 있습니다.
* html()로 html 문자열을 구합니다. html(String value) 메소드로 inner HTML 을 설정합니다.
* outerHtml() 요소의 outer html을 반환합니다.
inner HTML 은 요소가 포함하는 html을 나타내고, outer html 은 요소 자체 태그까지 포함하는 것입니다.
String html = "<An <a href="http://example.com/"><b>example</b></a> link.</p>";
Document doc = Jsoup.parse(html);
Element link = doc.select("a").first();
String text = doc.body().text(); // "An example link"
String linkText = link.text(); // "example"
String linkHref = link.attr("href"); // "http://example.com/"
String linkInnerH = link.html(); // "<b>example</b>"
String linkOuterH = link.outerHtml(); // "<a href="http://example.com"><b>example</b></a>"