Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment