我正在使用 Jsoup 获取外部 html 文档,但 Jsoup 仅获取 html 文档的一半。这是我的http://www.myanmarinternetjournal.com/content/8287
我可以知道我需要添加什么标题吗?
谢谢亚历克斯
protected String doInBackground(String... urls) {
try {
String data = "";
Document doc = null;
doc = Jsoup.connect(urls[0])
.header("Accept-Encoding", "gzip, deflate")
.header("Content-Type", "application/x-javascript; charset=utf-8")
.userAgent("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0")
.get();
Log.e("RssDetailsActivity", doc.toString());
Elements elements = doc.getElementsByClass("content clearfix");
for(Element element : elements) {
data += element.outerHtml();
data += "<br/>";
}
return data;
} catch (Exception e) {
Log.e("RssDetailsActivity", e.getMessage());
}
return null;
}