Search in sources :

Example 1 with HtmlUnit

use of cn.virde.nymph.net.html.HtmlUnit in project nymph by Onnt.

the class Page method getPageByJavScript.

/**
	 * 这个方法怎么使用还不是很明确
	 * @author Blacard
	 * @Create 2016年12月8日 上午11:31:08
	 * @return
	 */
@SuppressWarnings("unused")
private String getPageByJavScript() {
    HtmlUnit htmlUnit = new HtmlUnit();
    String page = "";
    try {
        page = htmlUnit.getPage(pageUrl);
    } catch (FailingHttpStatusCodeException e) {
        e.printStackTrace();
    } catch (MalformedURLException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
    return page;
}
Also used : MalformedURLException(java.net.MalformedURLException) FailingHttpStatusCodeException(com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException) IOException(java.io.IOException) HtmlUnit(cn.virde.nymph.net.html.HtmlUnit)

Aggregations

HtmlUnit (cn.virde.nymph.net.html.HtmlUnit)1 FailingHttpStatusCodeException (com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException)1 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1