[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

How to login in a page whit a ruby program

Emmanuel Cruz

12/15/2008 1:22:00 PM

I need to make a program for login and logout in a web site
(www.zenzuu.com)
--
Posted via http://www.ruby-....

3 Answers

Jason Trebilcock

12/15/2008 2:08:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

On Mon, Dec 15, 2008 at 7:22 AM, Emmanuel Cruz <ecruzg_10@hotmail.com>wrote:

> I need to make a program for login and logout in a web site
> (www.zenzuu.com)
> --
> Posted via http://www.ruby-....
>
>
One option would be to use Watir: http://wtr.ruby...

That's a good starting point.

Mark Thomas

12/15/2008 2:44:00 PM

0

That's what Mechanize is for.

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

jannschu@googlemail.com

12/15/2008 5:03:00 PM

0

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