Skip to content

Instantly share code, notes, and snippets.

@kristianhellquist
Created December 7, 2010 12:03
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 kristianhellquist/731726 to your computer and use it in GitHub Desktop.
Save kristianhellquist/731726 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'mechanize'
a = Mechanize.new { |agent|
agent.user_agent_alias = 'Mac Safari'
}
a.get('http://www.finn.no/finn/travel/air/search') do |page|
search_result = page.form_with(:action => '/finn/travel/air/progress') do |search|
search.locOriginName = 'Stockholm'
search.locDestinationName = 'Oslo'
search.depDate="09.12.2010"
search.retDate="11.12.2010"
search.noOfAdults = "1"
end.submit
search_result.links.each do |link|
puts link.text
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment