views:

68

answers:

2

Using any language (php, java, ruby, python), what's the best way to login to a website programmatically from the server? (for example, login to amazon, jetblue, etc. )

Are there are some frameworks to make this easier?

+2  A: 

You could use Ruby or Python with Mechanize (ruby implementation, python implementation).

Mechanize is basically a browser and you can have it programmatically submit forms or send the appropriate HTTP request/response data to maintain a "fake" session.

There are a number of these kinds of tools, I've recently had some good experiences using python+mechanize.

Mark E
Also had good success with python + mechanize. Also BeautifulSoup for HTML parsing along with mechanize
goggin13
A: 

Unfortunately, this has to be configured on a per-site basis. Each site uses its own login forms / urls, and potentially uses a different-named cookie (or whatever) to track your login session.

Stephen C