hotel_price 0.5.6 → 0.5.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4032b76766cf85f77988bddc0bfb08c0e2520151649cf480e24bc243c7a5e699
4
- data.tar.gz: 73ab442fc9b859c4c4cb8a529c9d2b46f5dc3d1da2a217499646945c356d7002
3
+ metadata.gz: 7a238e76090c742fb9853184bdc3af2b062bfec971635d7e25944e96ab028b60
4
+ data.tar.gz: 9f1b26e87a46a327bc66588298d3ad1c599519bbd2ef8a1fc0361970c4f5cc87
5
5
  SHA512:
6
- metadata.gz: 82ac37e8446bd5d3160cc7623956bd4d07a67c69027f6422f8960010d1fa5d30d23c73f4d16af7af8d5428cc36b2bbeaa1c80105a005447d3bb4ac633c1af94f
7
- data.tar.gz: 3c44a8bec12eb334a86e32822dfa97896d65beeadbde37f1f2d94dd0100442906c9415b4377c4f448a658d90929b75e23ab56836b5b245013ab73f5446bdc64e
6
+ metadata.gz: 69960789ac56c5f8a08251c7c492dfe6672e3d0925b574c3bc1efb206fb0832b5ecbac7796ba141fe9bbcc12159b1a7720b28aeca5b1ef19360c247080a85403
7
+ data.tar.gz: 8a4d5c362aae20d2081f1f2945a6418607738578bca532139688234ce9f4b81ecc73c334dd9805394a2efd41ec7c40efc4e6aafce712fe6ff677fc4ccffe2049
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hotel_price (0.5.5)
4
+ hotel_price (0.5.6)
5
5
  activesupport (~> 6.0.2.1)
6
6
  json (~> 2.3.0)
7
7
  nokogiri (~> 1.10.9)
@@ -23,7 +23,7 @@ module HotelPrice
23
23
  def self.rakuten_travel
24
24
  driver = self.get_selenium_driver
25
25
  rakuten_travel_hotel_id = 128552
26
- driver.get("https://travel.rakuten.co.jp/HOTEL/#{rakuten_travel_hotel_id.to_s}/review.html")
26
+ driver.get("https://travel.rakuten.co.jp/HOTEL/#{rakuten_travel_hotel_id}/review.html")
27
27
  sleep 2
28
28
  comment_area = driver.find_elements(:class_name, "commentReputationBoth")
29
29
  comment_area.map do |f|
@@ -46,9 +46,12 @@ module HotelPrice
46
46
  when 2
47
47
  Selenium::WebDriver.for :firefox
48
48
  else
49
- options = Selenium::WebDriver::Firefox::Options.new
49
+ options = Selenium::WebDriver::Chrome::Options.new
50
+ options.add_argument("--ignore-certificate-errors")
51
+ options.add_argument("--disable-popup-blocking")
52
+ options.add_argument("--disable-translate")
50
53
  options.add_argument("-headless")
51
- Selenium::WebDriver.for :firefox, options: options
54
+ Selenium::WebDriver.for :chrome, options: options
52
55
  end
53
56
  end
54
57
 
@@ -20,9 +20,10 @@ module HotelPrice::Jalan
20
20
  plan_name: f.find_element(class_name: "p-planCassette__header").text
21
21
  }
22
22
  rescue StandardError
23
+ { date: date, min_price: 0 }
23
24
  end
24
25
  end
25
- @price_box.sort_by { |_a, _b, c| c }.reverse.first
26
+ @price_box.sort_by { |_a, _b, c| c }.reverse.first || { date: date, min_price: 0 }
26
27
  rescue StandardError
27
28
  { date: date, min_price: 0 }
28
29
  end
@@ -1,3 +1,3 @@
1
1
  module HotelPrice
2
- VERSION = "0.5.6"
2
+ VERSION = "0.5.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hotel_price
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fumitake Kawasaki
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-04-20 00:00:00.000000000 Z
12
+ date: 2020-04-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler