Here you can find the source of getDocument(final String url)
public static final Document getDocument(final String url) throws MalformedURLException, IOException
//package com.java2s; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; public class Main { private static final String USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1309.0 Safari/537.17"; private static final int CONNECTION_TIMEOUT = 60000; public static final Document getDocument(final String url) throws MalformedURLException, IOException { return getDocument(new URL(url)); }//from w w w . j av a2s.com public static final Document getDocument(final URL url) throws IOException { return Jsoup.connect(url.toString()).ignoreContentType(true).timeout(CONNECTION_TIMEOUT) .userAgent(USER_AGENT).get(); } }