import org.apache.commons.io.IOUtils;
import java.io.InputStream;
import java.net.URL;
public class URLDemo {
public static void main(String[] args) throws Exception {
URL url = new URL("http","www.baidu.com", 80, "/");
InputStream inputStream = url.openStream();
System.out.println(IOUtils.toString(inputStream, "utf-8"));
}
}