I need to make a program for login and logout in a web site (www.zenzuu.com)
on 2008-12-15 15:29
on 2008-12-15 16:15
On Mon, Dec 15, 2008 at 7:22 AM, Emmanuel Cruz <email@example.com>wrote: > 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.
on 2008-12-15 16:46
That's what Mechanize is for. http://mechanize.rubyforge.org/mechanize/
on 2008-12-15 19:05
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