baidu 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/baidu.rb +2 -2
- metadata +1 -1
data/lib/baidu.rb
CHANGED
@@ -117,7 +117,7 @@ class BaiduResult
|
|
117
117
|
@ranks[id]['href'] = a.first['href'].sub('http://www.baidu.com/link?url=','').strip
|
118
118
|
unless url.nil?
|
119
119
|
url = url.text.strip
|
120
|
-
@ranks[id]['host'] = URI(URI.encode("http://#{url}")).host
|
120
|
+
@ranks[id]['host'] = Addressable::URI.parse(URI.encode("http://#{url}")).host
|
121
121
|
else
|
122
122
|
@ranks[id]['host'] = nil
|
123
123
|
end
|
@@ -162,4 +162,4 @@ class BaiduResult
|
|
162
162
|
def next
|
163
163
|
@page = BaiduResult.new(Mechanize.new.click(@page.link_with(:text=>/下一页/))) unless @page.link_with(:text=>/下一页/).nil?
|
164
164
|
end
|
165
|
-
end
|
165
|
+
end
|