Downloading TV listings with urllib
darrell
dgallion1 at yahoo.com
Thu Apr 17 20:35:33 EDT 2003
This worked.
print gzip.GzipFile(fileobj=cStringIO.StringIO(tvg().read()) ).read()
--Darrell
Gerhard Häring wrote:
> Josh wrote:
>> On 17 Apr 2003, you wrote in comp.lang.python:
>>>Josh wrote: [...]
>>>> h.putheader('Accept-Encoding:',
>>>> 'gzip,deflate,compress;q=0.9') [...]
>>>>when I use err.read() to read the object returned I get everything in
>>>>Hex.
>>>
>>>My guess is that you get what you're asking for - gzip-compressed
>>>data.
>>
>> Well I don't want gzipped data. I want HTML so I can parse it and
>> capture
>> the listings table into a list or something. Any ideas?
>
> Don't tell the webserver that you'll accept gzip-compressed data?
>
> I. e. remove the line I quoted above.
>
> -- Gerhard
More information about the Python-list
mailing list