Module: HotelPrice
- Defined in:
- lib/hotel_price.rb,
lib/hotel_price/agoda.rb,
lib/hotel_price/jalan.rb,
lib/hotel_price/booking.rb,
lib/hotel_price/expedia.rb,
lib/hotel_price/rakuten.rb,
lib/hotel_price/version.rb
Defined Under Namespace
Modules: Agoda, Booking, Expedia, Jalan, Rakuten Classes: Configuration, Error
Constant Summary collapse
- VERSION =
"0.6.2"
Class Attribute Summary collapse
-
.configuration ⇒ Object
Returns the value of attribute configuration.
Class Method Summary collapse
Class Attribute Details
.configuration ⇒ Object
Returns the value of attribute configuration.
15 16 17 |
# File 'lib/hotel_price.rb', line 15 def configuration @configuration end |
Class Method Details
.configure {|configuration| ... } ⇒ Object
18 19 20 21 |
# File 'lib/hotel_price.rb', line 18 def self.configure self.configuration ||= Configuration.new yield(configuration) end |
.rakuten_travel ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/hotel_price.rb', line 23 def self.rakuten_travel driver = self.get_selenium_driver rakuten_travel_hotel_id = 128552 driver.get("https://travel.rakuten.co.jp/HOTEL/#{rakuten_travel_hotel_id}/review.html") sleep 2 comment_area = driver.find_elements(:class_name, "commentReputationBoth") comment_area.map do |f| { status: "success", date: f.find_element(class_name: "time").text, rakuten_hotel_id: rakuten_travel_hotel_id, comment: f.find_element(class_name: "commentSentence").text } end end |