Skip to content

Instantly share code, notes, and snippets.

@getnashty
Created April 22, 2015 20:22
Show Gist options
  • Save getnashty/2e8623a45d4121feb7a4 to your computer and use it in GitHub Desktop.
Save getnashty/2e8623a45d4121feb7a4 to your computer and use it in GitHub Desktop.
#gem 'capybara'
#gem 'poltergeist', '>= 1.6.0'
require 'capybara'
require 'capybara/poltergeist'
include Capybara::DSL
Capybara.default_driver = :poltergeist
visit "http://www.bing.com/maps/default.aspx?q=waltham+restaurants&mkt=en&FORM=HDRSC4"
puts 'sleepy time'
sleep(6)
puts 'WAKEUP! (ya wanted to)'
all('.ypEntity').each do |thing|
t1 = thing.find('.ypEntityCntr')
title = t1.find('.entityTitle').text
puts title
end
all(".posts .post").each do |post|
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment