I am using JSoup to download and parse the Android Issues Page. This is my code so far:
URL url = null;
try {
url = new URL(
"http://www.google.com/support/androidmarket/developer/bin/static.py?page=known_issues.cs");
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
Document document = Jsoup.parse(url, 5000);
EditText bla;
bla = (EditText) this.findViewById(R.id.editText1);
bla.setText(document.toStrin开发者_如何学Gog());
if (document.toString().contains("recentfixes")) {
Toast.makeText(this, "YES", 1).show();
}
Well, the weird thing is, that the WHOLE page is parsed, BUT the section with recent fixes. This is a wget output and this is the parsed output.
Can you help me with that?
Try using .connect instead.
The following should give you the entire page's text:
URL url = null;
try {
url = new URL(
"http://www.google.com/support/androidmarket/developer/bin/static.py?page=known_issues.cs");
} catch (MalformedURLException e) {
e.printStackTrace();
}
try {
Document document = Jsoup.connect(url).timeout(0).get();
String entireText = document.text();
} catch (IOException e) {
e.printStackTrace();
}
精彩评论