hotel_price 0.3.7 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/hotel_price/rakuten/rakuten_console.rb +1 -1
- data/lib/hotel_price/rakuten/rakuten_scraper.rb +12 -0
- data/lib/hotel_price/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a22861f4708dba324ef8f028527961fefb087435821d853e95f88dbe9083ebd5
|
4
|
+
data.tar.gz: 28dbdcad4bef039222ca579cb4bb4a2cb8e111aad37653991666b65287ca6517
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c415172a89791a5ab6f469b0ef9c726333d065c411abae4a8490c2edfddd4356f4f38765f3024be89d9e3298d60de5117370503331c51b963176608cb941a77
|
7
|
+
data.tar.gz: 8f177c1d244c7557b0f64533d66a092b864394586388df5f00048b63ce60899c074e36ed11077f7ff5e15e968fb4bdb1496a7584424c8beba072dfb9bb4efb5a
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
hotel_price (0.3.
|
4
|
+
hotel_price (0.3.7)
|
5
5
|
activesupport (~> 6.0.2.1)
|
6
6
|
json (~> 2.3.0)
|
7
7
|
nokogiri (~> 1.10.9)
|
@@ -45,7 +45,7 @@ GEM
|
|
45
45
|
childprocess (>= 0.5, < 4.0)
|
46
46
|
rubyzip (>= 1.2.2)
|
47
47
|
thread_safe (0.3.6)
|
48
|
-
tzinfo (1.2.
|
48
|
+
tzinfo (1.2.7)
|
49
49
|
thread_safe (~> 0.1)
|
50
50
|
zeitwerk (2.3.0)
|
51
51
|
|
@@ -10,7 +10,7 @@ module HotelPrice::Rakuten
|
|
10
10
|
options = Selenium::WebDriver::Firefox::Options.new
|
11
11
|
options.add_argument("-headless")
|
12
12
|
@wait = Selenium::WebDriver::Wait.new(:timeout => 100)
|
13
|
-
@driver = Selenium::WebDriver.for :firefox
|
13
|
+
@driver = Selenium::WebDriver.for :firefox, options: options
|
14
14
|
if @config[:chain]
|
15
15
|
go_to_management_page_chain
|
16
16
|
else
|
@@ -49,6 +49,18 @@ module HotelPrice::Rakuten
|
|
49
49
|
plan_num.size
|
50
50
|
end
|
51
51
|
|
52
|
+
def self.get_dayuse_plan_num rakuten_hotel_id
|
53
|
+
driver = self.get_selenium_driver
|
54
|
+
driver.get "https://hotel.travel.rakuten.co.jp/hotelinfo/plan/#{rakuten_hotel_id}"
|
55
|
+
sleep 10
|
56
|
+
driver.find_element(:id, "du-radio").click
|
57
|
+
driver.find_element(:id, "dh-submit").click
|
58
|
+
sleep 10
|
59
|
+
plan_num = driver.find_elements(:class, "planThumb")
|
60
|
+
driver.quit
|
61
|
+
plan_num.size
|
62
|
+
end
|
63
|
+
|
52
64
|
def self.get_selenium_driver
|
53
65
|
# firefox_capabilities = Selenium::WebDriver::Remote::Capabilities.firefox
|
54
66
|
# @driver = Selenium::WebDriver.for(:remote, url: "http://hub:4444/wd/hub", desired_capabilities: firefox_capabilities)
|
data/lib/hotel_price/version.rb
CHANGED