gsearch-parser 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/gsearch-parser.gemspec +1 -1
- data/lib/gsearch-parser.rb +2 -5
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
data/gsearch-parser.gemspec
CHANGED
data/lib/gsearch-parser.rb
CHANGED
@@ -32,14 +32,11 @@ class GoogleSearch
|
|
32
32
|
# Iterate over each Google result list element
|
33
33
|
searchPage.css('li.g').each do |result|
|
34
34
|
# Extract the title
|
35
|
-
title = result.css('h3').first.inner_html
|
35
|
+
title = result.css('h3 > a').first.inner_html
|
36
36
|
|
37
37
|
# Extract the content. There is the possibility for
|
38
38
|
# the content to be nil, so check for this
|
39
|
-
content = result.css('span.st').first
|
40
|
-
if !content
|
41
|
-
content = ''
|
42
|
-
end
|
39
|
+
content = result.css('span.st').first.nil? ? '' : result.css('span.st').first.inner_html
|
43
40
|
|
44
41
|
# Extract the URI
|
45
42
|
uri = result.css('cite').first.inner_html
|