qunar 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/qunar/hotel.rb +2 -2
- data/lib/qunar/rank.rb +5 -2
- data/lib/qunar/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8cdffb70710b1fbff0aa1c15ee32d65d4864994
|
4
|
+
data.tar.gz: 78cbb58939792e8e3ff33bda55a9f2c1dd4f85b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6a440427c2e623c18546607f6beff0c6cf6c8910494b6170f9575fc6778b820d17d024efe1e11fc3c90f1b257e04bd723924a2bc4e51f03b262424ae6f6e7b2
|
7
|
+
data.tar.gz: fd5ff8d88c9ebbcbbe0d26efa82ff9557f6048338ec486adbc1f0e876df038d995bdb4c4f6d7584580189ea999c347056e8ded820c1783f929f9468b70b018b2
|
data/lib/qunar/hotel.rb
CHANGED
@@ -51,7 +51,7 @@ module Qunar
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def id
|
54
|
-
@hotelcode = @hotelcode
|
54
|
+
@hotelcode = @hotelcode.to_i
|
55
55
|
end
|
56
56
|
|
57
57
|
def address
|
@@ -81,7 +81,7 @@ module Qunar
|
|
81
81
|
return 0 if match_data.nil?
|
82
82
|
match_data = match_data[0].match(/[\d]+/)
|
83
83
|
return 0 if match_data.nil?
|
84
|
-
match_data[0].strip
|
84
|
+
match_data[0].strip.to_i
|
85
85
|
end
|
86
86
|
|
87
87
|
def coordinate
|
data/lib/qunar/rank.rb
CHANGED
@@ -21,6 +21,9 @@ module Qunar
|
|
21
21
|
all('//*[text()="展开报价"]').each do |btn|
|
22
22
|
btn.click
|
23
23
|
end
|
24
|
+
all('//*[text()="全部订完"]').each do |btn|
|
25
|
+
btn.click
|
26
|
+
end
|
24
27
|
#@page = Capybara.current_session.driver.browser.page_source #use when choose capybara driver selenium
|
25
28
|
@page = Capybara.current_session.driver.browser.body #use when choose capybara driver webkit
|
26
29
|
@hotel = Nokogiri::HTML @page
|
@@ -76,10 +79,10 @@ module Qunar
|
|
76
79
|
otas['prepay'] = prepay
|
77
80
|
|
78
81
|
price = row.search("p[@class='final-price ']/b").first.text.strip
|
79
|
-
otas['price'] = price
|
82
|
+
otas['price'] = price.to_i
|
80
83
|
|
81
84
|
neat_price = row.search("p[@class='count_pr']").first.children[1].to_s
|
82
|
-
otas['neat_price'] = neat_price
|
85
|
+
otas['neat_price'] = neat_price.to_i
|
83
86
|
|
84
87
|
room['otas'] << otas
|
85
88
|
end
|
data/lib/qunar/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qunar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JusticeChow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|