2

Everytime I try to scrape a page e.g.

 HtmlPage page1 = (HtmlPage)client.GetHtmlPage("https://groceries.morrisons.com/");

I get the following error:

Additional information: java.lang.RuntimeException: Could not generate DH keypair

Web Client settings

    NHtmlUnit.WebClient client = new NHtmlUnit.WebClient();
    client.Options.CssEnabled = false;
    client.Options.JavaScriptEnabled = false;
    client.Options.AppletEnabled = false;
Amit Verma
  • 40,709
  • 21
  • 93
  • 115
Vil
  • 135
  • 1
  • 2
  • 12

1 Answers1

2

edit:

Is there a way to force NHTMLUNIT to Ignore Page JavaScript errors and Continue Script Execution?

Try ignoring the errors. If that does not work, you are most likely out of luck due to a java bug leading to this error due to a too long keylength of the TLS encryption.

Community
  • 1
  • 1
sjas
  • 18,644
  • 14
  • 87
  • 92
  • Im not sure how i can fixed this since im using a NHtmlUnit liprary :/ As far as i know NHtmlUnit usis IKVM to run java code – Vil Jul 12 '15 at 14:46