How to get the cookie from a website?

Recently,I am confused that how to get cookie from a website.I installed
Mechanize,but don't know how to use it.need help.

···

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

Mechanize does keep track of the cookies that are set during various requests.

Quick example:

require 'mechanize'

agent = Mechanize.new
agent.get 'https://google.com'
p agent.cookies

A few resources:

http://mechanize.rubyforge.org/
http://mechanize.rubyforge.org/Mechanize/CookieJar.html
http://mechanize.rubyforge.org/Mechanize/Cookie.html

···

On Apr 15, 2013, at 5:53 AM, song yangyang <lists@ruby-forum.com> wrote:

I am confused that how to get cookie from a website.

agent = Mechanize.new
page = agent.get("http://www.google.com/&quot;\)
agent.cookies

Jesus.

···

On Mon, Apr 15, 2013 at 11:53 AM, song yangyang <lists@ruby-forum.com> wrote:

Recently,I am confused that how to get cookie from a website.I installed
Mechanize,but don't know how to use it.need help.