[http-html-unit] how to enable javascript
Alex <[email protected]>
| Newsgroups | gmane.comp.web.httpunit.devel,gmane.comp.java.htmlunit.general |
|---|---|
| Message-ID | <[email protected]> |
Using httpunit.....
WebConversation wc = new WebConversation();
WebResponse resp =
wc.getResponse("http://www.dicentral.com/html/7support/browsercheckprocess.a
sp");
InputStream in = resp.getInputStream();
...
while ( ( line = buf.readLine() ) != null )
{
System.out.println(line);
} //end of while
I get source code.
Javascript is disabled..
JavaScript
Failed
JavaScript is disabled. Please change your browser settings to allow
JavaScript!
Has anyone actually tried it and was able to enable javascript and read raw
source code of a page? Any help is appreciated
(when tried using htmlunit was getting exceptions)
WebClient webClient = new WebClient();
HtmlPage page = (HtmlPage)webClient.getPage(new URL(myURL)); //exception
is here
WebResponse w = page.getWebResponse();
InputStream in = w.getContentAsStream();
//then here I want to extract every line from InputStream as a String.
Apr 7, 2006 10:42:21 PM
com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter runtimeError
SEVERE: runtimeError: message=[ActiveXObject Error: no map for
PipelineLauncherX.PipelineLauncherCom.1.]
sourceName=[http://i.a.cnn.net/cnn/.element/ssi/js/1.3/main.js] line=[465]
lineSource=[null] lineOffset=[0]
Apr 7, 2006 10:42:21 PM
com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter runtimeError
SEVERE: runtimeError: message=[ActiveXObject Error: no map for
CNNPipelineLauncherX.PipelineLauncherCom.1.]
sourceName=[http://i.a.cnn.net/cnn/.element/ssi/js/1.3/main.js] line=[465]
lineSource=[null] lineOffset=[0
.......