Skip to content

Instantly share code, notes, and snippets.

@aldrinmartoq
Last active December 16, 2015 16:25
Show Gist options
  • Save aldrinmartoq/066407640ed7c6d76243 to your computer and use it in GitHub Desktop.
Save aldrinmartoq/066407640ed7c6d76243 to your computer and use it in GitHub Desktop.
Ejemplo extraer tarifa más baja de un vuelo
require 'webdrone'
a0 = Webdrone.create browser: :chrome, create_outdir: true, timeout: 30
a0.open.url 'http://www.delta.com/'
a0.shot.screen 'inicio'
a0.form.set 'originCity', 'SCL'
a0.form.set 'destinationCity', 'SDQ'
a0.form.set 'departureDate', '12/24/2015'
a0.form.set 'returnDate', '1/30/2016'
a0.shot.screen 'otro'
a0.clic.link 'Close'
a0.wait.time 1
a0.clic.on 'Flexible Days'
a0.clic.on 'Find Flights'
a0.shot.screen 'busqueda'
a0.wait.for do
a0.find.on 'UPDATE RESULTS'
end
a0.mark.css '.lowestFare'
x = a0.text.css '.lowestFare'
a0.shot.screen 'fin'
puts "TARIFA MÁS BAJA: #{x}"
Webdrone.irb_console(binding)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment