class Apartments::Scraper

Public Class Methods

scrape_detail(url) click to toggle source
# File lib/apartments/scraper.rb, line 17
def self.scrape_detail(url)
  Nokogiri::HTML(open(url))
end

Public Instance Methods

get_page() click to toggle source
# File lib/apartments/scraper.rb, line 3
def get_page
  Nokogiri::HTML(open("https://newyork.craigslist.org/d/housing/search/hhh"))
end
make_apartments() click to toggle source
# File lib/apartments/scraper.rb, line 11
def make_apartments
  scrape_apartments.each do |apt|
    Apartments::Apartment.new_from_index_page(apt)
 end
end
scrape_apartments() click to toggle source
# File lib/apartments/scraper.rb, line 7
def scrape_apartments
  self.get_page.css('li.result-row')
end