html - Jsoup return tag with empty body -


i trying scrap data - http://www.giantbomb.com/bioshock-infinite/3030-32317/ . can required tag , content inside tag missing .

 element element =  document.body().getelementbyid("site-main").getelementbyid("mantle_skin")                                    .getelementbyid("wrapper").select("div.js-toc-generate").select("form.wikigroup").first().getelementbyid("site")                                    .getelementbyid("default-content").select("aside.secondary-content.span4 ").first();  log.e("hi",element.tostring()); 

code works fine till second last call "select" . when add last "select" function empty tag body .

output

<aside class="secondary-content span4 ">  </aside> 

as can see element found there no body though have 1 when looking @ html code . there solution ?

this worked fine on java not in android . adding useragent() fix issue

docuemnt doc = jsoup.connect(params[0]).useragent("mozilla/5.0 (macintosh; intel mac os x 10_9_2) applewebkit/537.36 (khtml, gecko) chrome/33.0.1750.152 safari/537.36").get(); 

Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -