jsoup解析页面报错
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jsoup解析页面报错相关的知识,希望对你有一定的参考价值。
Document doc = null;
String url = "http://www.mof.gov.cn/zhengwuxinxi/bulinggonggao/tongzhitonggao/";
try
Connection conn = Jsoup.connect(url).timeout(10000);
if(conn.execute().statusCode() == 200)
doc = conn.get();
报的错误为:
java.io.EOFException
at java.util.zip.GZIPInputStream.readUByte(GZIPInputStream.java:207)
at java.util.zip.GZIPInputStream.readUShort(GZIPInputStream.java:197)
at java.util.zip.GZIPInputStream.readUInt(GZIPInputStream.java:189)
at java.util.zip.GZIPInputStream.readTrailer(GZIPInputStream.java:179)
at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:94)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:256)
at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
at java.io.FilterInputStream.read(FilterInputStream.java:90)
at org.jsoup.helper.DataUtil.readToByteBuffer(DataUtil.java:124)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:464)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:410)
at org.jsoup.helper.HttpConnection.execute(HttpConnection.java:164)
at com.lawstar.auto.util.GetUrlByTagtr.main(GetUrlByTagtr.java:19)
问题补充:
该方法解析别的页面没有问题,就解析上面 那个网址报错,求大神就根据此网址解析解决错误
以上是关于jsoup解析页面报错的主要内容,如果未能解决你的问题,请参考以下文章