开发者

JSoup doesn't parse Android Known Issues Page

开发者 https://www.devze.com 2023-04-11 03:25 出处:网络
I am using JSoup to download and parse the Android Issues Page. This is my code so far: URL url = null;

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();
}
0

精彩评论

暂无评论...
验证码 换一张
取 消