tags:

views:

93

answers:

2

hi, i am using htmlunit to parse a page. but when i tried to get page from url i got an exception, lets have a look on my code:

WebClient wc = new WebClient(BrowserVersion.FIREFOX_3); HtmlPage page = wc.getPage(strUrl);

when compilet goes to wc.getPage(strUrl) it throws an exception i.e.

java.io.EOFException at java.util.zip.GZIPInputStream.readUByte(Unknown Source) at java.util.zip.GZIPInputStream.readUShort(Unknown Source) at java.util.zip.GZIPInputStream.readHeader(Unknown Source) at java.util.zip.GZIPInputStream.(Unknown Source) at java.util.zip.GZIPInputStream.(Unknown Source) at com.gargoylesoftware.htmlunit.WebResponseData.getBody(WebResponseData.java:129) at com.gargoylesoftware.htmlunit.WebResponseData.(WebResponseData.java:87) at com.gargoylesoftware.htmlunit.HttpWebConnection.newWebResponseDataInstance(HttpWebConnection.java:452) at com.gargoylesoftware.htmlunit.HttpWebConnection.makeWebResponse(HttpWebConnection.java:432) at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:104) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1407) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1340) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:299) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:360) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:345) at com.htmlunit.test.IHGHotelTest.main(IHGHotelTest.java:39)

any one have an idea about it

A: 

Can you provide the URL? A reproducible case is needed.

Ahmed Ashour
A: 

here is the url:

-kayak--USHSP-_-NYCHA">http://www.ichotelsgroup.com/redirect?brandCode=ic&regionCode=1&localeCode=en&path=asearch&errorURL=/h/d/6c/1/en/rates&successURL=/h/d/6c/1/en/rc/NYCHA/IGCOR/K1KNIGCOR/GX/false/0&availabilitySearchSuccessURL=/h/d/6c/1/en/rc/NYCHA/IGCOR/K1KNIGCOR/GX/false/0?ias=y&actionName=availabilitySearch&hotelCode=NYCHA&checkInDate=10&checkInMonthYear=62010&checkOutDate=12&checkOutMonthYear=62010&numberOfAdults=1&numberOfChildren=0&numberOfRooms=1&smokingPreference=3&secure=true&rateTypeCodes=6CBARC&rateChangePeriod=&_PMID=99609020&cm_mmc=mdpr--kayak--USHSP-_-NYCHA

when we try to get page (webClient.getPage(url)) it throws following exception

java.io.EOFException at java.util.zip.GZIPInputStream.readUByte(Unknown Source) at java.util.zip.GZIPInputStream.readUShort(Unknown Source) at java.util.zip.GZIPInputStream.readHeader(Unknown Source) at java.util.zip.GZIPInputStream.(Unknown Source) at java.util.zip.GZIPInputStream.(Unknown Source) at com.gargoylesoftware.htmlunit.WebResponseData.getBody(WebResponseData.java:129) at com.gargoylesoftware.htmlunit.WebResponseData.(WebResponseData.java:87) at com.gargoylesoftware.htmlunit.HttpWebConnection.newWebResponseDataInstance(HttpWebConnection.java:452) at com.gargoylesoftware.htmlunit.HttpWebConnection.makeWebResponse(HttpWebConnection.java:432) at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:104) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1407) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1340) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:299) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:360) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:345)