java - Why doesn't HTMLunit work on this https webpage? -


I am trying to learn more about HTMLunit and do some tests at this time. I am trying to get basic information like the page title and text of this site:

(The full URL is removed, the important part is that it is https)

Code used by me, which is working fine on other websites:

  last webclient webClient = new webclient (); Final HTML page page; Page = (HTMLpc) webclient.tv ("https://medeczane.sgk.gov.tr/eczane/login.jsp"); Println (page.getTitleText ()); Println (page.asText ());   

Why can not I find this basic information? If this is due to security measures, then what is special and can I bypass them? Thank you.

Edit: Hmmm code stops working after webclient.getpage (); , Test2 is not written. So I do not know if the page is empty or not.

  The Ultimate Webclient Webclient = New Webclient (BrowserWrite.FIREFOX_2); Final HTML page page; Println ("test1"); Try {page = (HTMLPage) webClient.getPage ("https://medeczane.sgk.gov.tr/eczane/login.jsp"); Println ("test2"); I resolved it by adding the line of this code:  
 

webClient.setUseInsecureSSL (true);

The way to disable secure SSL is deprecated In the current HtmlUnit version you must:

  webClient.getOptions (). SetUseInsecureSSL (true);    

Comments