@@ -0,0 +1,1635 @@
+package com.stara.crawler;%0A%0Aimport java.io.IOException;%0Aimport java.net.MalformedURLException;%0Aimport java.util.Map;%0A%0Aimport com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;%0Aimport com.gargoylesoftware.htmlunit.WebClient;%0Aimport com.gargoylesoftware.htmlunit.html.HtmlPage;%0A%0Apublic class WebClientMain %7B%0A    %0A    private static final WebClient WEB_CLIENT = new WebClient();%0A    %0A    static%7B%0A        WEB_CLIENT.getOptions().setCssEnabled(false);%0A        WEB_CLIENT.getOptions().setJavaScriptEnabled(false);%0A    %7D%0A    %0A    public static String asText(Map%3CString, String%3E params,String url)%7B%0A        HtmlPage page = null;%0A        try %7B%0A            page = WEB_CLIENT.getPage(url);%0A            closeWebClient(WEB_CLIENT);%0A            return page.asText();%0A        %7D catch (FailingHttpStatusCodeException e) %7B%0A            e.printStackTrace();%0A        %7D catch (MalformedURLException e) %7B%0A            e.printStackTrace();%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A        %7D%0A        return null;%0A    %7D%0A    %0A    public static String asXML(Map%3CString, String%3E params,String url)%7B%0A        HtmlPage page = null;%0A        try %7B%0A            page = WEB_CLIENT.getPage(url);%0A            closeWebClient(WEB_CLIENT);%0A            return page.asXml();%0A        %7D catch (FailingHttpStatusCodeException e) %7B%0A            e.printStackTrace();%0A        %7D catch (MalformedURLException e) %7B%0A            e.printStackTrace();%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A        %7D%0A        return null;%0A    %7D%0A    %0A    public static void closeWebClient(WebClient webClient)%7B%0A        webClient.close();%0A    %7D%0A%7D%0A

add htmlUnit libs