Re: URLLIb2 problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jerry Hill

    Re: URLLIb2 problem

    On Mon, Jun 30, 2008 at 4:11 PM, <leechat2001@gm ail.comwrote:
    I am trying to write somecode of this kind :)
    >
    opener = urllib2.build_o pener(urllib2.H TTPCookieProces sor())
    opener.addheade rs = [
    ....
    ('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.some thing 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
Working...