안녕하세요 HTML 파싱을 구현하고있는 한 학생입니다
아래와 같은 class를 이용해 파싱을 구현하고있는데요
public String htmlDownloader(String surl) {
StringBuilder text = new StringBuilder();
text.append( "" );
try {
URL url = new URL(surl);
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
if (conn != null ) {
conn.setConnectTimeout( 10000 );
conn.setUseCaches( false );
if (conn.getResponseCode() == HttpURLConnection.HTTP_OK){
BufferedReader br = new BufferedReader ( new InputStreamReader(conn.getInputStream(), "UTF-8" ));
for (;;) {
String line = br.readLine();
if (line == null ) {
break ;
}
text.append(line);
}
br.close();
}
conn.disconnect();
}
}
catch (Exception ex) {}
String result = text.toString();
Log.d( "" , "asdf " +result);
return result;
}
|
마지막에 Log.d("", "asdf "+result); 에서 찍힌 로그를 보면
전체 html이 나오지 않고 어딘가에서 짤리고 특정 길이까지만 받아오는것 같은데
어디가 문제인지 잘모르겠습니다 ㅠㅠ 도와주세요