[Tutor] HTTP_User_Agent?

Daniel Coughlin kauphlyn@speakeasy.org
Thu, 24 May 2001 00:40:54 -0700 (PDT)


Thank you, Hunter.

I now also realise I was using a backslash instead of a
forward slash (for how long will this plague me!!!).

The script now does return a user agent string.

Any idea what I should put as the user agent to mimic recent versions of
Internet Explorer or Netscape?


On Wed, 23 May 2001, juno@gamefire.com wrote:

> Hey Daniel,
> I had the same problem until I removed the 4.0, then it worked. Try this:
>
> h.putheader('User-Agent', 'Mozilla')
>
> That should do it.
>
> Hunter
>
>
> -----Original Message-----
> From: tutor-admin@python.org [mailto:tutor-admin@python.org]On Behalf Of
> Daniel Coughlin
> Sent: Wednesday, May 23, 2001 4:32 PM
> To: tutor@python.org
> Subject: [Tutor] HTTP_User_Agent?
>
> Hello Everyone,
>
> I am trying to create a web client using python for use testing asp. My
> problem
> is formulating a user agent header so that the server thinks my bot is
> mozilla/4.0 compatible.
>
> I have written a test asp page that returns the user agent varible. And this
> works fine with an ordinary browser.
>
> My python script contains the following line:
>
> h.putheader('User-Agent', 'Mozilla/4.0')
>
> However, when I test the script against my test page, no user_agent is
> returned
> at all.
>
> So I am guessing I have written it incorrectly. Does anyone out there know
> how
> to do this sort of thing?
>
> Many thanks in advance,
>
> Daniel
>
>
>
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>