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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 37e155ad5c882faa1b543fc3f875b417ed2f903a
4
- data.tar.gz: 18089df07af8acfc609da7552d2282eae2ff05d3
3
+ metadata.gz: 9c41c16b665f552c632a8dda302e73a6171beec1
4
+ data.tar.gz: f3976f3436ecf2b6a19956b78e2810653950aa6a
5
5
  SHA512:
6
- metadata.gz: 6736db5b2e411387cf6401b888b0e20b723483801e05fd80aab0a7823c65740f9a047b019b51f45c92b45dfa91c3004a94a215e750f039123b6246028e884934
7
- data.tar.gz: 0123239f14dc80688a682a362e27f3739731a71b53a8ff836a56f655df04766040e1adfcb7df2f95c5d121d2e1e6b45856954a50287bf4dcdc6cb48a407932cb
6
+ metadata.gz: 6c8945b319ef6c9889a16d042895507e811205300ffe60c09c87d8552c5cd76b0cf8a606103ef832f63cf447fdcd9832ac932dde69e8b3c8eeb6988e70f06eb3
7
+ data.tar.gz: 719ccd76cc02991c0fd8813358ea646e2ba29fe0b1d0cf82d5315fcb654e73dc263311036726a87debdd239b48706635a6881c164b316cf2773f2128971ac3d2
@@ -89,7 +89,7 @@ class SerpScraper::Google
89
89
  doc = Nokogiri::HTML(html)
90
90
  results = Array.new
91
91
 
92
- rows = doc.css('div.rc h3.r > a')
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.push({
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
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'serp_scraper'
3
- s.version = '1.0.4'
3
+ s.version = '1.1'
4
4
  s.date = '2017-05-26'
5
5
 
6
6
  s.homepage = 'https://github.com/kjellberg'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serp_scraper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: '1.1'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rasmus Kjellberg