script detection

Michael Hudson mwh at python.net
Mon Jan 28 08:56:17 EST 2002


cyclotron at gmx.net (cyclotron) writes:

> Ok thanx,
> I'm fairly new to Python and I don't know anything about browser
> identification. Do I add it with .putheader() ?
> my code looks something like that:
> ------
>         h = httplib.HTTP('www.domain.com')
>         h.putrequest('GET', url)
>         h.putheader('Cookie', 'username=myname%123456789')
>         h.endheaders()
>         errcode, errmsg, headers = h.getreply()
>         f = h.getfile()
>         print( f.read() )
> ------
> I get a page where it says something about that my login was
> successful (so I think the cookie part works) but it also says "We
> don't support scripts" in the html code.
> How can I fake the browser identification? I couldn't find useful
> information about it on the net.

You need a h.putheader("User-Agent", something), I believe.

Referrer may be necessary, too.

Cheers,
M.

-- 
  If you don't have friends with whom to share links and conversation,
  you have social problems and you should confront them instead of
  joining a cultlike pseudo-community.    -- "Quit Slashdot.org Today!"
   (http://www.cs.washington.edu/homes/klee/misc/slashdot.html#faq)



More information about the Python-list mailing list