baidu 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/baidu.rb +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c0a22fe6ad7297b0c4be73cdbe8fefa9b37ad07d
|
|
4
|
+
data.tar.gz: 3c19af83a1f22af79404235ee8fef61d165b7677
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bf07f1e9e4684cb3ad7aff369b964bc0919a974e5ba526f98103f89206bf03ec198c16fe8543834a77cac25e345cc82a65feb8327ac307d7d2c86f3b0be86add
|
|
7
|
+
data.tar.gz: ae6d28052860af86faa7540e67e6c1df19678f080f459da2c0519eed4ab37f71907bbf12479355de11c0bb848d71185ffbcc6e80e4c1ddca95d1902702245bc7
|
data/lib/baidu.rb
CHANGED
|
@@ -256,7 +256,9 @@ class MbaiduResult < SearchResult
|
|
|
256
256
|
=end
|
|
257
257
|
#下一页
|
|
258
258
|
def next
|
|
259
|
-
|
|
259
|
+
nextbutton = @body.xpath('//a[text()="下一页"]').first
|
|
260
|
+
return nil if nextbutton.nil?
|
|
261
|
+
url = nextbutton['href']
|
|
260
262
|
url = URI.join(@baseuri,url).to_s
|
|
261
263
|
body = HTTParty.get(url)
|
|
262
264
|
return MbaiduResult.new(body,url,@pagenumber+1)
|