Re: URLLIb2 problem
- From: "Jerry Hill" <malaclypse2@xxxxxxxxx>
- Date: Mon, 30 Jun 2008 16:29:59 -0400
On Mon, Jun 30, 2008 at 4:11 PM, <leechat2001@xxxxxxxxx> wrote:
I am trying to write somecode of this kind :)....
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor())
opener.addheaders = [
('Accept-Encoding','gzip,deflate'),....
urllib2.install_opener(opener)
fu = urllib2.urlopen('http://www.google.com')
print fu.read()
I am not able to open any webpage as the content is junk
characters.something like below..what could be the
problem?????????????
You told the website that you would accept gzip encoded data, and it
looks like the website decided to send you some. You need to either
take that header out of your opener, or actually handle the gzipped
data that's being sent back to you.
--
Jerry
.
- References:
- URLLIb2 problem
- From: leechat2001
- URLLIb2 problem
- Prev by Date: Re: URLLIb2 problem
- Next by Date: Re: Freeze problem with Regular Expression
- Previous by thread: Re: URLLIb2 problem
- Index(es):