Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to deal with "Unexpected end of file from server"?
    primarykey
    data
    text
    <p>I want to use Jsoup to crawl content of from <a href="http://ws.audioscrobbler.com/2.0/?method=track.getInfo&amp;api_key=550633c179112c8002bc6a0942d55b2a&amp;artist=lucinda%20williams&amp;track=lake%20charles" rel="nofollow">http://ws.audioscrobbler.com/2.0/?method=track.getInfo&amp;api_key=550633c179112c8002bc6a0942d55b2a&amp;artist=lucinda%20williams&amp;track=lake%20charles</a> </p> <p>The codes are :</p> <pre><code> Document doc = Jsoup.connect("http://ws.audioscrobbler.com /2.0/?method=track.getInfo&amp;api_key=550633c179112c8002bc6a0942d55b2a&amp;artist=lucinda williams&amp;track=lake charles") .userAgent("Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:20.0) Gecko/20100101 Firefox/20.0") .timeout(5000) .get(); </code></pre> <p>However, something wrong happens:</p> <pre><code> Exception in thread "main" java.net.SocketException: Unexpected end of file from server at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:770) at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633) at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:767) at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1162) at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:397) at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:429) at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:410) at org.jsoup.helper.HttpConnection.execute(HttpConnection.java:164) at org.jsoup.helper.HttpConnection.get(HttpConnection.java:153) at JsoupXML.main(JsoupXML.java:16) </code></pre> <p>But, when I use brwoser to visit the url, eveything is OK. Besides, when I use above codes to crawl content of <a href="http://ws.audioscrobbler.com/2.0/?method=track.getInfo&amp;api_key=550633c179112c8002bc6a0942d55b2a&amp;artist=cher&amp;track=believe" rel="nofollow">http://ws.audioscrobbler.com/2.0/?method=track.getInfo&amp;api_key=550633c179112c8002bc6a0942d55b2a&amp;artist=cher&amp;track=believe</a> , everything is OK too.</p> <p>Could you know the reason and any good ideas to solve it?</p> <p>Thanks for your attention and sorry about my english.</p> <p>Thanks for NeplatnyUdaj's kindly help, you give me wonderful hint. I forgot to replace whitspace and other special symbols with %20,%26 and so on.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload