我在一个android应用程序中使用jsoup来获取一个url,我得到了这个错误并且搜索了很多但找不到答案,你能给我一些建议吗?谢谢!我在Android 2.1模拟器中测试,代码如下:
Document doc;
String firstHash = "";
try {
doc = Jsoup.connect(mURL)
.userAgent("Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0")
.timeout(10000).followRedirects(true).execute().parse();
firstHash = doc.body().text();
} catch (Exception e) {
e.printStackTrace();
}
堆栈跟踪如下:
10-20 08:42:37.586: W/System.err(223): org.jsoup.HttpStatusException: HTTP error fetching URL. Status=-1, URL=http://www.shooter.cn/files/file3.php?hash=duei7chy7gj59fjew73hdwh213f&fileid=244789
10-20 08:42:37.606: W/System.err(223): at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:435)
10-20 08:42:37.606: W/System.err(223): at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:410)
10-20 08:42:37.606: W/System.err(223): at org.jsoup.helper.HttpConnection.execute(HttpConnection.java:164)