import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.api.ContentResponse; import org.eclipse.jetty.util.ssl.SslContextFactory; public class WebCrawler { public static void main(String[] args) throws Exception { HttpClient httpClient = new HttpClient(new SslContextFactory.Client()); httpClient.start(); String url = "https://example.com"; ContentResponse response = httpClient.GET(url); System.out.println(response.getContentAsString()); httpClient.stop(); } }


上一篇:
下一篇:
切换中文