hotel_price 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hotel_price.rb +12 -7
- data/lib/hotel_price/agoda/agoda_scraper.rb +1 -12
- data/lib/hotel_price/booking/booking_scraper.rb +0 -13
- data/lib/hotel_price/expedia/expedia_scraper.rb +0 -13
- data/lib/hotel_price/jalan/jalan_scraper.rb +0 -14
- data/lib/hotel_price/rakuten/rakuten_scraper.rb +0 -14
- 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: 721f3ad16dfb1b86f930d6f9f420590ed1774f56653f1793ed2267deb8668ded
|
4
|
+
data.tar.gz: 7b4096b1eba821639226712dae8f36ba1adc09a1e01cc5bc756f2b3a0f60dc9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1acfb4cecec62bf16f2e8b5c167151f15f2dbb99757b0a44f4771091f98cb80820e57cbb9e36cd4df1d8693eba74747d11ca8758f9c4b1eee7457f45d023fc6b
|
7
|
+
data.tar.gz: d372e2383be49bee1a3ae3db191abfea5806208d6eb7d3b36bd4cd393db3552f425b48c36bbe94e086f4735ee932116cf9a047ef47c584cf83c26dd5aa76d99e
|
data/lib/hotel_price.rb
CHANGED
@@ -38,13 +38,18 @@ module HotelPrice
|
|
38
38
|
|
39
39
|
private
|
40
40
|
|
41
|
-
def self.get_selenium_driver
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
41
|
+
def self.get_selenium_driver(mode = 0)
|
42
|
+
case mode
|
43
|
+
when 1
|
44
|
+
firefox_capabilities = Selenium::WebDriver::Remote::Capabilities.firefox
|
45
|
+
Selenium::WebDriver.for(:remote, url: "http://selenium-hub:4444/wd/hub", desired_capabilities: firefox_capabilities)
|
46
|
+
when 2
|
47
|
+
Selenium::WebDriver.for :firefox
|
48
|
+
else
|
49
|
+
options = Selenium::WebDriver::Firefox::Options.new
|
50
|
+
options.add_argument("-headless")
|
51
|
+
Selenium::WebDriver.for :firefox, options: options
|
52
|
+
end
|
48
53
|
end
|
49
54
|
|
50
55
|
class Configuration
|
@@ -44,17 +44,6 @@ module HotelPrice::Agoda
|
|
44
44
|
"adults=#{num_adults}"
|
45
45
|
end
|
46
46
|
|
47
|
-
|
48
|
-
if mode == 1
|
49
|
-
firefox_capabilities = Selenium::WebDriver::Remote::Capabilities.firefox
|
50
|
-
Selenium::WebDriver.for(:remote, url: "http://selenium-hub:4444/wd/hub", desired_capabilities: firefox_capabilities)
|
51
|
-
elsif mode == 2
|
52
|
-
Selenium::WebDriver.for :firefox
|
53
|
-
else
|
54
|
-
options = Selenium::WebDriver::Firefox::Options.new
|
55
|
-
options.add_argument("-headless")
|
56
|
-
Selenium::WebDriver.for :firefox, options: options
|
57
|
-
end
|
58
|
-
end
|
47
|
+
|
59
48
|
end
|
60
49
|
end
|
@@ -46,18 +46,5 @@ module HotelPrice::Booking
|
|
46
46
|
return "" if num_adults.to_i <= 1
|
47
47
|
"group_adults=#{num_adults}&group_children=0"
|
48
48
|
end
|
49
|
-
|
50
|
-
def self.get_selenium_driver(mode = 0)
|
51
|
-
if mode == 1
|
52
|
-
firefox_capabilities = Selenium::WebDriver::Remote::Capabilities.firefox
|
53
|
-
Selenium::WebDriver.for(:remote, url: "http://selenium-hub:4444/wd/hub", desired_capabilities: firefox_capabilities)
|
54
|
-
elsif mode == 2
|
55
|
-
Selenium::WebDriver.for :firefox
|
56
|
-
else
|
57
|
-
options = Selenium::WebDriver::Firefox::Options.new
|
58
|
-
options.add_argument("-headless")
|
59
|
-
Selenium::WebDriver.for :firefox, options: options
|
60
|
-
end
|
61
|
-
end
|
62
49
|
end
|
63
50
|
end
|
@@ -45,18 +45,5 @@ module HotelPrice::Expedia
|
|
45
45
|
return "" if num_adults.to_i <= 1
|
46
46
|
"rm1=a#{num_adults}"
|
47
47
|
end
|
48
|
-
|
49
|
-
def self.get_selenium_driver(mode = 0)
|
50
|
-
if mode == 1
|
51
|
-
firefox_capabilities = Selenium::WebDriver::Remote::Capabilities.firefox
|
52
|
-
Selenium::WebDriver.for(:remote, url: "http://selenium-hub:4444/wd/hub", desired_capabilities: firefox_capabilities)
|
53
|
-
elsif mode == 2
|
54
|
-
Selenium::WebDriver.for :firefox
|
55
|
-
else
|
56
|
-
options = Selenium::WebDriver::Firefox::Options.new
|
57
|
-
options.add_argument("-headless")
|
58
|
-
Selenium::WebDriver.for :firefox, options: options
|
59
|
-
end
|
60
|
-
end
|
61
48
|
end
|
62
49
|
end
|
@@ -43,19 +43,5 @@ module HotelPrice::Jalan
|
|
43
43
|
return "" if num_adults.to_i < 1
|
44
44
|
"adultNum=#{num_adults}"
|
45
45
|
end
|
46
|
-
|
47
|
-
def self.get_selenium_driver(mode = 0)
|
48
|
-
if mode == 1
|
49
|
-
firefox_capabilities = Selenium::WebDriver::Remote::Capabilities.firefox
|
50
|
-
Selenium::WebDriver.for(:remote, url: "http://selenium-hub:4444/wd/hub", desired_capabilities: firefox_capabilities)
|
51
|
-
elsif mode == 2
|
52
|
-
Selenium::WebDriver.for :firefox
|
53
|
-
else
|
54
|
-
options = Selenium::WebDriver::Firefox::Options.new
|
55
|
-
options.add_argument("-headless")
|
56
|
-
Selenium::WebDriver.for :firefox, options: options
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
46
|
end
|
61
47
|
end
|
@@ -116,19 +116,5 @@ module HotelPrice::Rakuten
|
|
116
116
|
detail_class_code: ""
|
117
117
|
}
|
118
118
|
end
|
119
|
-
|
120
|
-
def self.get_selenium_driver(mode = 0)
|
121
|
-
if mode == 1
|
122
|
-
firefox_capabilities = Selenium::WebDriver::Remote::Capabilities.firefox
|
123
|
-
Selenium::WebDriver.for(:remote, url: "http://selenium-hub:4444/wd/hub", desired_capabilities: firefox_capabilities)
|
124
|
-
elsif mode == 2
|
125
|
-
Selenium::WebDriver.for :firefox
|
126
|
-
else
|
127
|
-
options = Selenium::WebDriver::Firefox::Options.new
|
128
|
-
options.add_argument("-headless")
|
129
|
-
Selenium::WebDriver.for :firefox, options: options
|
130
|
-
end
|
131
|
-
end
|
132
|
-
|
133
119
|
end
|
134
120
|
end
|
data/lib/hotel_price/version.rb
CHANGED