Can i use HtmlUnit to listen for resource loading events?
问题 I'm trying to use HtmlUnit to detect resources (scripts, images, stylesheets, etc) that fail to load on a webpage. I've tried new WebConnectionWrapper(webClient) { @Override public WebResponse getResponse(WebRequest request) throws IOException { WebResponse response; response = super.getResponse(request); System.out.println(response.getStatusCode()); return response; } }; to no avail. It doesn't seem to handle CSS, images or JS, despite HtmlUnit logging: statusCode=[404] contentType=[text