On Mon, Jun 30, 2008 at 4:11 PM,  <[EMAIL PROTECTED]> 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
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to