baiduserp 2.0.3 → 2.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/baiduserp/parser.rb +1 -1
- data/lib/baiduserp/version.rb +1 -1
- data/lib/parsers/pinpaizhuanqu.rb +2 -1
- data/lib/parsers/right_personinfo.rb +2 -1
- data/lib/parsers/right_relaperson.rb +2 -2
- 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: b76e9892fceaa4719a61d4aed6fb01b8b01166d6
|
4
|
+
data.tar.gz: da46214d67c3f50436f1a7860096bf643e1c876e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b16b248268416b165ac3a2811c858bd279afeeca6baaac7dd5aa834e80668ebd87822e04cc2ad07e792a33e7ad688dabb9fe4eb0e06c3daeaed9d62e2605d58e
|
7
|
+
data.tar.gz: ecca635c80e68467dce468e738b25246a386c2d48d5f1811108daaf881fe677926a31984b04c4552eddc8e25c6017c353e6cacbb86a4fc8d093a32edbe9b7740
|
data/lib/baiduserp/parser.rb
CHANGED
@@ -9,6 +9,7 @@ module Baiduserp
|
|
9
9
|
Dir[File.expand_path('../../parsers/*.rb', __FILE__)].each{|f| require f}
|
10
10
|
|
11
11
|
def parse(html)
|
12
|
+
html = html.encode!('UTF-8','UTF-8',:invalid => :replace)
|
12
13
|
@file = Hash.new
|
13
14
|
@serp = Hash.new
|
14
15
|
|
@@ -35,7 +36,6 @@ module Baiduserp
|
|
35
36
|
else
|
36
37
|
html = Client.get(URI.escape(file_path)).body
|
37
38
|
end
|
38
|
-
html = html.encode!('UTF-8','UTF-8',:invalid => :replace)
|
39
39
|
parse html
|
40
40
|
end
|
41
41
|
end
|
data/lib/baiduserp/version.rb
CHANGED
@@ -4,10 +4,11 @@ class Baiduserp::Parser
|
|
4
4
|
return nil if rp.nil?
|
5
5
|
|
6
6
|
title = Baiduserp::Helper.get_content_safe rp.search('span.opr-personinfo-subtitle-large')
|
7
|
+
info_summary = Baiduserp::Helper.get_content_safe rp.search('div.opr-personinfo-summary')
|
7
8
|
info = Baiduserp::Helper.get_content_safe rp.search('div.opr-personinfo-info')
|
8
9
|
source = Baiduserp::Helper.get_content_safe rp.search('div.opr-personinfo-source a')
|
9
10
|
|
10
11
|
return nil if title.nil? && info.nil? && source.nil?
|
11
|
-
{:title => title, :info => info, :source => source}
|
12
|
+
{:title => title, :info_summary => info_summary, :info => info, :source => source}
|
12
13
|
end
|
13
14
|
end
|
@@ -7,8 +7,8 @@ class Baiduserp::Parser
|
|
7
7
|
relapersons.each do |rr|
|
8
8
|
title = rr.search('span.opr-relaperson-subtitle-tip').first.content
|
9
9
|
r = []
|
10
|
-
rr.search('p.opr-relaperson-name').each do |p|
|
11
|
-
r << p
|
10
|
+
rr.search('p.opr-relaperson-name/a').each do |p|
|
11
|
+
r << p['title']
|
12
12
|
end
|
13
13
|
result << {:title => title, :names => r}
|
14
14
|
end
|