I am using web client. and login successfully through web client. but when i send second request for getting data . I got an Exception
com.gargoylesoftware.htmlunit.UnexpectedPage@6d8d73`
but when i pass url thruogh brouser i got a data Json format.
Code:
webClient.getPage("http://ajax/stream/refresh-box?r=new&id=2323222&")
Thx in advanced
this is the which is reading different content type through web client
Page page = webClient.getPage(url);
System.out.println(page);
WebResponse response = page.getWebResponse();
if (response.getContentType().equals("application/json"))
{
pagesource = response.getContentAsString();
System.out.println(pagesource);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With