The Artima Developer Community
Sponsored Link

Python Answers Forum
Logging in to website via python

1 reply on 1 page. Most recent reply: Apr 20, 2004 6:47 AM by Girts Kalnins

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Will Clinton

Posts: 1
Nickname: turnpike
Registered: Apr, 2004

Logging in to website via python Posted: Apr 16, 2004 11:40 PM
Reply to this message Reply
Advertisement
Recently I've been messing around with the urllib module, and been having a fairly good time of it. However, now I decided I'd try to put it to some use. What I need to be able to do is log in to a site just as I would through a normal browser. The site in question doesn't use cookies, so that isn't a problem. I need to know how to send a username/pass (using the POST method), and then possibly how to spoof an HTTP REFERRER or anything else that could be used to keep my script logged in.

Thanks a ton! If you think this would be better done in PHP, that also works, as I have some experience/familiarity with that language. However, I know little to nothing about other languages such as Perl


Girts Kalnins

Posts: 23
Nickname: smejmoon
Registered: May, 2003

Re: Logging in to website via python Posted: Apr 20, 2004 6:47 AM
Reply to this message Reply
http://www.python.org/doc/current/lib/module-urllib.html

import urllib
urllib.urlopen(url, urllib.urlencode({'parm1':'value1', 'parm2':'value2'}

Flat View: This topic has 1 reply on 1 page
Topic: place(relx=1, x=-260, y=360, anchor="ne") Previous Topic   Next Topic Topic: getting an exe to execute from a website

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use