page_by_page 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/page_by_page/version.rb +1 -1
- data/lib/page_by_page.rb +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b503de846c6f14e44ebb68d6da30f0647e3a9e42
|
4
|
+
data.tar.gz: 0b74d6adf88048ed8a78441ec24fad1f686c8ac7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 032d1274977d459339c51d44648b56ba3eb066818137866ed8c80753f0b9009bebf40a59ef614601034e56e02d466a8636cbf5af86bb9b68309da20c01ba09bd
|
7
|
+
data.tar.gz: 70f97621564edf8ccbade3a23131ca53722f5e7357382d1803ffdf5e17cb1a359e397ac2d6d32c97d8411bca1391a2bc1c51aae6e9378ae1dd508cf50d254f40
|
data/lib/page_by_page/version.rb
CHANGED
data/lib/page_by_page.rb
CHANGED
@@ -51,13 +51,13 @@ class PageByPage
|
|
51
51
|
@enum = MutexEnum.new options
|
52
52
|
parallel_fetch
|
53
53
|
end
|
54
|
-
nodes_2d.flatten
|
54
|
+
nodes_2d.reject(&:nil?).flatten
|
55
55
|
end
|
56
56
|
|
57
57
|
private
|
58
58
|
|
59
59
|
def _fetch
|
60
|
-
items,
|
60
|
+
items, pages = [nil], []
|
61
61
|
catch :no_more do
|
62
62
|
until items.empty?
|
63
63
|
n = @enum.next
|
@@ -65,10 +65,10 @@ class PageByPage
|
|
65
65
|
url = @tmpl.result binding
|
66
66
|
doc = parse url
|
67
67
|
items = doc.css @selector
|
68
|
-
|
68
|
+
pages[n] = items
|
69
69
|
end
|
70
70
|
end
|
71
|
-
|
71
|
+
pages
|
72
72
|
end
|
73
73
|
|
74
74
|
def parallel_fetch
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: page_by_page
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ken
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
version: '0'
|
109
109
|
requirements: []
|
110
110
|
rubyforge_project:
|
111
|
-
rubygems_version: 2.
|
111
|
+
rubygems_version: 2.6.7
|
112
112
|
signing_key:
|
113
113
|
specification_version: 4
|
114
114
|
summary: scrape page by page , according to url pattern
|