[python-win32] Re: Python win32 version of Variant
Roger Upole
rwupole at msn.com
Fri May 6 15:14:52 CEST 2005
The Headers parm is just a string containing normal http request headers,
something like
'User-Agent: fakebrowser\nReferer: somepage.html\nMethod: POST\n\n'
hth
Roger
----- Original Message -----
From: "Roy S. Rapoport" <python-win32 at ols.inorganic.org>
To: <python-win32 at python.org>
Sent: Friday, May 06, 2005 5:45 AM
Subject: [python-win32] Python win32 version of Variant
> Having done Python programming for a while on UNIX platforms, I'm finding
> that win32 com stuff is ... interesting. My main current challenge is
> that
> I need to drive Internet Explorer to do some web testing. Now, this is
> actually somewhat decently done (and IEC.py does some of the heavy lifting
> anyway). The problem I'm running into is trying to actually authenticate
> using basic auth.
>
> Now, I know how basic auth works -- I just need to make IE navigate to a
> given URL after having added a header with the authentication information.
> IE's com interface even lets me do that, as
> http://msdn.microsoft.com/workshop/browser/webbrowser/reference/methods/navigate.asp
>
> documents -- I just need to give it a Headers variable as the fifth
> argument. What I'm trying to figure out, however, is how to do that. The
> doc indicates the headers are to be given as a Variant, but I have no idea
> what that means in Python-land. I've tried
> ie.Navigate(<URL>, None, None, None, <headers as dict>)
> and
> ie.Navigate(<URL>, None, None, None, <header as string>)
>
> to no avail.
>
> Any suggestions as to what I'm missing or, even better, what documentation
> I might be able to find that answers this question? This definitely seems
> like an RTFM sort of thing -- I just don't know what to look for.
>
> -roy
>
>
More information about the Python-win32
mailing list