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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/baidu.rb +3 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d30156372afea5bc627eb164cc998dddd0da6407
4
- data.tar.gz: bca43c17d3494b0492e7e581bd0701ae2f69089e
3
+ metadata.gz: c0a22fe6ad7297b0c4be73cdbe8fefa9b37ad07d
4
+ data.tar.gz: 3c19af83a1f22af79404235ee8fef61d165b7677
5
5
  SHA512:
6
- metadata.gz: dd97c6be975e891cf802445dbbd2f06b7903ee1658df17df7ddaa7182b893824f1fe1bf8ba89ad1cda82991af3ab2d3a34ccd6d838734d50238a82273a3e0225
7
- data.tar.gz: 495d2bf3f99beb3258e7f48505b6cb6d3c87ad69892798a22fe236bfc4eeff364b8c62b6eb6d8b51b3446893d3764d76add03314ae217d83008325d3c60d3f88
6
+ metadata.gz: bf07f1e9e4684cb3ad7aff369b964bc0919a974e5ba526f98103f89206bf03ec198c16fe8543834a77cac25e345cc82a65feb8327ac307d7d2c86f3b0be86add
7
+ data.tar.gz: ae6d28052860af86faa7540e67e6c1df19678f080f459da2c0519eed4ab37f71907bbf12479355de11c0bb848d71185ffbcc6e80e4c1ddca95d1902702245bc7
@@ -256,7 +256,9 @@ class MbaiduResult < SearchResult
256
256
  =end
257
257
  #下一页
258
258
  def next
259
- url = @body.xpath('//a[text()="下一页"]').first['href']
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: baidu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - seoaqua