Last active
August 29, 2015 14:24
-
-
Save vlad-shatskyi/bcd5fdacc740435f704c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Scraper::BookingCom | |
class RoomBot < BotBase | |
include Scraper::ScrapingCommon | |
HTTP_RESPONSE_VALIDATORS = [ | |
:nil_response, :status_404, :status_200, :html, | |
->(url, resp) { raise(CustomExceptions::InvalidUrlError, url) if resp.uri.path.include?("searchresults") } | |
] | |
def scrape | |
page = get(url) | |
validate_http_response!(url, page) | |
HotelEntities::HotelPage.new(page).rates | |
end | |
end | |
end | |
module Scraper::BookingCom | |
class RoomBot < BotBase | |
include Scraper::ScrapingCommon | |
def scrape | |
RateBot.new(smth).scrape.rates | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment