Software caused connection abort: recv failed

Exception in thread "main" java.net.SocketException: Software caused connection abort: recv failed

at java.net.SocketInputStream.socketRead0(Native Method)

at java.net.SocketInputStream.read(SocketInputStream.java:152)

at java.net.SocketInputStream.read(SocketInputStream.java:122)

at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)

at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)

at java.io.BufferedInputStream.read(BufferedInputStream.java:334)

at sun.net. www.http.HttpClient.parseHTTPHeader(HttpClient.java:687)

at sun.net. www.http.HttpClient.parseHTTP(HttpClient.java:633)

at sun.net. www.http.HttpClient.parseHTTP(HttpClient.java:658)

at sun.net. www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1323)

at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)

at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:516)

at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:493)

at org.jsoup.helper.HttpConnection.execute(HttpConnection.java:205)

at org.jsoup.helper.HttpConnection.get(HttpConnection.java:194)

at com.itcast.jsoup.TestJsoup.main(TestJsoup.java:13)


添加浏览器信息

Document document = Jsoup.connect(startPage).userAgent("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0").get();

























你可能感兴趣的:(qa)