안드로이드 개발 질문/답변
(글 수 45,052)
<tbody> <tr class='new'>
<td class="no">84</td>
<td class="title">
<td class="attach"> </td>
<td class="author"> 용석태 </td>
<td class="date">2011.07.15</td>
<td class="hit">211</td></tr>
여기 있는 내용을 파싱해오려고 합니다.
Source source = new Source(new URL("
"http://www.syu.ac.kr/web/kor/comm_a_02"));
source.fullSequentialParse(); postItem postItems = new postItem();
//우선 TD엘리먼트 밑에 있는 엘리먼트들을 다 불러오구요..
List rootList = source.getAllElements(HTMLElementName.TD);
for (Iterator it = rootList.iterator(); it.hasNext();) {
//다음 엘리먼트들을 봐요..
Element linkEmlElement = (Element) it.next();
//그리고 class 엘리먼트를 찾은다음
String name = linkEmlElement.getAttributeValue("class");
PostItem.add(postItems);
//class이름이 no 인것을 찾아서.
if (name.equals("no")) {
//value에 넣어줍니다. 84가 들어가야되는데..뭐가 문제에요???
String value = linkEmlElement.getTextExtractor().toString();
postItems.setNo(value);
}
틀린부분이 있거나..수정할 부분이 있으면 알려주세요.ㅠㅠ



