Forum: Ruby Emulating Browser Session (like Curl)?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
27008c071530bf894e3a1c9488ed67b6?d=identicon&s=25 Joe R. (joe)
on 2006-06-13 03:46
I have a process that I want to emulate:

- login (and remember cookies set)
- access pages that require being logged in

With Curl, it's pretty easy:

curl -c cookies -d "username=joe&password=12345" secret.com/login
curl -b cookies secret.com/dostuff

I searched for Curl Ruby libraries and found:

http://www.d1.dion.ne.jp/~matuyuki/ruby.html (0.0.2 alpha)
http://rox-ruby.sourceforge.net/cms.php/curl (pre-alpha - May 2003)

Any other options, or libraries? Is open-uri capable of something
similar?

Thanks,
Joe
Logan Capaldo (Guest)
on 2006-06-13 03:59
(Received via mailing list)
On Jun 12, 2006, at 9:47 PM, Joe Ruby wrote:

> I searched for Curl Ruby libraries and found:
> --
> Posted via http://www.ruby-forum.com/.
>

Methinks you require WWW::Mechanize
http://www.ntecs.de/blog/Blog/WWW-Mechanize.rdoc
Aaron Patterson (Guest)
on 2006-06-13 05:52
(Received via mailing list)
On Tue, Jun 13, 2006 at 10:47:06AM +0900, Joe Ruby wrote:
> I searched for Curl Ruby libraries and found:
>
> http://www.d1.dion.ne.jp/~matuyuki/ruby.html (0.0.2 alpha)
> http://rox-ruby.sourceforge.net/cms.php/curl (pre-alpha - May 2003)
>
> Any other options, or libraries? Is open-uri capable of something
> similar?

Check out WWW::Mechanize:

http://mechanize.rubyforge.org/

Or just install it: 'gem install mechanize'

--Aaron
This topic is locked and can not be replied to.