Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

23 lines (19 sloc) 0.637 kb
Railscasts Episode #191: Mechanize
http://railscasts.com/episodes/191
Commands
sudo gem install mechanize
script/console
require 'mechanize'
agent = WWW::Mechanize.new
agent.get("http://railscasts.tadalist.com/session/new")
agent.page.forms
form = agent.page.forms.first
form.password = "secret"
form.submit
agent.page.links
agent.page.links.first.text
agent.page.link_with(:text => "Wish List")
agent.page.link_with(:text => "Wish List").click
agent.page.search(".edit_item")
agent.page.search(".edit_item").map(&:text).map(&:strip)
puts Readline::HISTORY.entries.split("exit").last[0..-2].join("\n")
Jump to Line
Something went wrong with that request. Please try again.