Fly to the sky & Return

Jericho parser를 이용한 딴지일보 자유게시판 불러오기.....1 본문

프로그래밍/Java& Android

Jericho parser를 이용한 딴지일보 자유게시판 불러오기.....1

낼은어떻게 2015. 11. 21. 18:56
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

아직 완성단계는 아닙니당.. 일단   어떻게 하면 딴지일보 게시판을 손쉽게 안드폰이나아이패드에서 이용해볼까하는 맘에서 시작한 것이고

이제 막...  기초단계를 시작한 것입니다.. 


열심히 해서. 안드폰과 아이패드에서 쾌적한 딴게를 즐길수있도록 해보겠습니다. ㄷㄷㄷㄷ


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package test2;
 
import java.io.IOException;
import java.net.URL;
import java.util.List;
 
import net.htmlparser.jericho.Element;
import net.htmlparser.jericho.HTMLElementName;
import net.htmlparser.jericho.Source;
 
 
public class test2 {
 
     public static void main(String[] args) throws IOException {
         
         String yourUrl ="http://www.ddanzi.com/free";
         
         Source source = new Source(new URL(yourUrl));
         
         List<Element> elementListTd = source.getAllElements(HTMLElementName.TR);
 
            //Scroll through the list of elements "td" page
            for (Element element : elementListTd) {
                String attributevalue = element.getAttributeValue("class");
                if (attributevalue != null) {
                    String td = attributevalue.toString();
                    String conteudoAtributo = element.getTextExtractor().toString();
                    System.out.println(conteudoAtributo);
 
                   
 
                }
            }
         
         
     }
cs


일단 공지사항까지는 잘보입니당. ㄷㄷㄷㄷㄷ    


자유게시판 제목등등을 잘 읽어오는것은 다음 시간에..