crawlzone at gmail.com
Sun Oct 14 09:02:38 CEST 2012
On 10/13/2012 11:55 PM, Brian van den Broek wrote:
> On 14 October 2012 02:15, Ray Jones <crawlzone at gmail.com> wrote:
>> On 10/13/2012 07:50 PM, Steven D'Aprano wrote:
>>> If you can do `print e.info()`, then you can also do `info = e.info()`
>>> and inspect the info programmatically.
>> One would expect that to be true. But when I do info = e.info(), info is
>> <httplib.HTTPMessage instance at 0x85bdd2c>.
>> When I print e.info(), I get the following:
>> Content-Type: text/html
>> Connection: close
>> WWW-Authenticate: Basic realm="xxxx"
>> Content-Length: xx
>> I can iterate through e.info() with a 'for' loop, but all I get as a
>> result is:
>> In other words, I get the headers but not the corresponding values.
> That smells rather like you are dealing with a dictionary. What
> happens if you try
Bingo! That's it! Thank-you very much - I will now attempt to implement it.
More information about the Tutor