Skip to content

Instantly share code, notes, and snippets.

@ybur-yug
Created December 9, 2015 23:19
Show Gist options
  • Select an option

  • Save ybur-yug/bcce67be248f7747136f to your computer and use it in GitHub Desktop.

Select an option

Save ybur-yug/bcce67be248f7747136f to your computer and use it in GitHub Desktop.
require 'mechanize'
browser = Mechanize.new
listing_page_url = 'http://www.forsalebyowner.com/search/list/44135/20000:69999-price/proximity,desc-sort'
page = browser.get(listing_page_url)
listings = page.at(".estateSummary")
listings_text = listings.map(&:children).map(&:text)
listings_text.each do |text|
puts text
end

ghost commented Dec 9, 2015

Copy link
Copy Markdown

Thumbs upward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment