How to login in a page whit a ruby program


#1

I need to make a program for login and logout in a web site
(www.zenzuu.com)


#2

On Mon, Dec 15, 2008 at 7:22 AM, Emmanuel Cruz
removed_email_address@domain.invalidwrote:

I need to make a program for login and logout in a web site
(www.zenzuu.com)

Posted via http://www.ruby-forum.com/.

One option would be to use Watir: http://wtr.rubyforge.org/

That’s a good starting point.


#3

That’s what Mechanize is for.

http://mechanize.rubyforge.org/mechanize/


#4

Hi,

or you can use pure net/http from the standard lib. Then you only need
managing the cookies:

  1. load the login page and (if needed) extract the form data
  2. create a login post reqeuest and send it, store the cookies (if
    some) and send them back next time
  3. now you can open the next pages as if you were logged in

That’s all. Logout is simply open the logout page or send the logut
post request. Mechanize just helps you storing your cookies.
You will maybe also need something like nokogiri or hpricot for html
parsing.

jannschu