Я хочу соединиться с 'http://exo.smtown.com/Board/List/10724' или' http://exo.smtown.com/Board/List/?kind=1'(these на одной странице.)
Когда я соединяю страницы, загруженный контент выглядит как 'http://exo.smtown.com/Error/404.htm?aspxerrorpath=/Bo'
Как подключить страницу, а не страницу ошибки?
//doc = Jsoup.connect("http://exo.smtown.com/Board/List/10724").get(); doc = Jsoup.connect("http://exo.smtown.com/Board/List/?kind=1").get(); contents = doc.select("div"); String temp = contents.text(); Log.d("logg0","temp: "+temp);
Я ожидаю вывод «SM STAR Home ....», но фактический вывод - «페이지 를 찾을 수 없습니다 ....» *
+ Я пытался
protected Object doInBackground(Object[] params) { try { doc = Jsoup.connect("http://exo.smtown.com/Board/List/?kind=1").timeout(30000) .userAgent("Mozilla/5.0 (Windows; U; WindowsNT 5.1; en-US; rv1.8.1.6) Gecko/20070725 Firefox/2.0.0.6") .referrer("http://www.google.com").get(); contents = doc.select("div"); } catch (Exception e) { e.printStackTrace(); } String temp = contents.text(); Log.d("logg0","temp: "+temp);
+ также попробовал
doc = Jsoup.connect("http%3A%2F%2Fexo.smtown.com%2FBoard%2FList%2F10724").get();
попробуй
try { Jsoup.connect("http://exo.smtown.com/Board/List/?kind=1")) / required URL .timeout(30000) .userAgent("Mozilla/5.0 (Windows; U; WindowsNT 5.1; en-US; rv1.8.1.6) Gecko/20070725 Firefox/2.0.0.6") .referrer("http://www.google.com").get() .select("div") .ownText(); }catch (Exception e) { //handle exception }
Надеюсь, это поможет
Вам необходимо закодировать URL.
URLEncoder.encode(stringToBeEncoded, "UTF-8")
В вашем случае:
Document gDoc = JSoup.connect(placesURL.format(URLEncoder.encode("http://exo.smtown.com/Board/List/?kind=1", "UTF-8"))