serp_scraper 1.0.4 → 1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/engines/google.rb +4 -3
- data/serp_scraper.gemspec +1 -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: 9c41c16b665f552c632a8dda302e73a6171beec1
|
4
|
+
data.tar.gz: f3976f3436ecf2b6a19956b78e2810653950aa6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c8945b319ef6c9889a16d042895507e811205300ffe60c09c87d8552c5cd76b0cf8a606103ef832f63cf447fdcd9832ac932dde69e8b3c8eeb6988e70f06eb3
|
7
|
+
data.tar.gz: 719ccd76cc02991c0fd8813358ea646e2ba29fe0b1d0cf82d5315fcb654e73dc263311036726a87debdd239b48706635a6881c164b316cf2773f2128971ac3d2
|
data/lib/engines/google.rb
CHANGED
@@ -89,7 +89,7 @@ class SerpScraper::Google
|
|
89
89
|
doc = Nokogiri::HTML(html)
|
90
90
|
results = Array.new
|
91
91
|
|
92
|
-
rows = doc.css(
|
92
|
+
rows = doc.css("h3.r a:not(.sla)")
|
93
93
|
|
94
94
|
position = 1
|
95
95
|
rows.each do |row|
|
@@ -101,16 +101,17 @@ class SerpScraper::Google
|
|
101
101
|
|
102
102
|
url = Addressable::URI.parse(external_url)
|
103
103
|
|
104
|
+
puts row['href']
|
104
105
|
next unless url.host # Only add valid URL's (ignore images, news etc)
|
105
106
|
|
106
|
-
results
|
107
|
+
results << {
|
107
108
|
position: position,
|
108
109
|
title: row.content,
|
109
110
|
scheme: url.scheme,
|
110
111
|
domain: url.host,
|
111
112
|
url: url.request_uri,
|
112
113
|
full_url: url.to_s
|
113
|
-
}
|
114
|
+
}
|
114
115
|
|
115
116
|
position += 1
|
116
117
|
|
data/serp_scraper.gemspec
CHANGED