This is the code:
WebClient client=new WebClient();
client.getOptions().setThrowExceptionOnFailingStatusCode(false);
client.getOptions().setThrowExceptionOnScriptError(false);
client.getPage("http://toutiao.com/a6321930090477568257");
The url http://toutiao.com/a6321930090477568257 can be opened with any browser but failed in htmlunit with error:
Exception in thread "main" java.lang.IllegalArgumentException: about://blank is not supported, only about:blank is supported now.
at com.gargoylesoftware.htmlunit.WebClient.makeWebResponseForAboutUrl(WebClient.java:1106)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1231)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:347)
at com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPageIfPossible(BaseFrameElement.java:184)
at com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPage(BaseFrameElement.java:122)
at com.gargoylesoftware.htmlunit.html.HtmlPage.loadFrames(HtmlPage.java:1843)
at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:242)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:489)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:351)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:421)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:401)
exception is shouldn't be threw when url starts with [about://blank].
this exception should be catched and doing nothing.
Last edit: jason.dong 2016-08-24
fixed in SVN
hi
i download the last version of htmlunit 2.23
and it still can't work
i still get this bug while parsing this website
any help?
Please try the latest snapshot