954,525 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Can python do this? How?

Helo All,

I need to write a python script that will automatically log into a website and retrieve a URL once it has logged in. I already know how to fetch the html of a page, but how do I make the script log into the page first?

On the page I want to login, the "Login" button does this:

Thanks!

ddwyer50
Newbie Poster
1 post since May 2005
Reputation Points: 10
Solved Threads: 0
 

I am just getting my feet wet with WEB programming in Python. I found these two articles very useful:

http://www.devshed.com/c/a/Python/Writing-CGI-Programs-in-Python/
http://www.devshed.com/c/a/Python/Python-on-the-Web/

vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 

You could use the urllib or urllib2 modules for this task I assume but you could also start from scratch using pure sockets. You would need to learn HTTP Protocol for this and simulate what messages a webbrowser sends to the server hosting the website for the user and password boxes.

here are some good starter websites on HTTP:
en.wikipedia.org/wiki/Hypertext_Transfer_Protocol
www.w3.org/Protocols/
This ones really good:
http://www.jmarshall.com/easy/http/

EAnder
Light Poster
49 posts since Feb 2008
Reputation Points: 26
Solved Threads: 5
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You