Skip to content

Instantly share code, notes, and snippets.

@jyootai
Created November 6, 2014 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jyootai/524f1fbdda2083a2292c to your computer and use it in GitHub Desktop.
Save jyootai/524f1fbdda2083a2292c to your computer and use it in GitHub Desktop.
Mechanize
require 'mechanize'
agent = Mechanize.new
url=" "
hash = {:name => ' ', :value => ' ', :path => '/', :domain => ' '}
cookie = Mechanize::Cookie.new(hash[:name], hash[:value])
cookie.domain = hash[:domain]
cookie.path = hash[:path]
agent.cookie_jar.add(URI.parse(url), cookie)
page = agent.get(" ")
pp page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment