Created
November 6, 2014 14:59
-
-
Save jyootai/524f1fbdda2083a2292c to your computer and use it in GitHub Desktop.
Mechanize
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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