htmlunit获取get请求

WebClient webClient = new WebClient();
    Page page = webClient.getPage("http://example.com");
    WebResponse response = page.getWebResponse();
    String content = response.getContentAsString();

API:

http://htmlunit.sourceforge.net/apidocs/com/gargoylesoftware/htmlunit/WebResponse.html#getContentAsString%28%29



你可能感兴趣的:(htmlunit获取get请求)