list_spider 0.1.0 → 0.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/list_spider.rb +4 -0
- data/lib/spider_base.rb +3 -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: f73a2e9b358cac55336907ac76ebdb666b9d31f5
|
4
|
+
data.tar.gz: 2df50eff29a1963224ca3f7d0cd9b3ac0c89156f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2cb02f9eb8593a05cc6b0a0c9d015ad93bf08663750d3dfe3007c30febfaa47d57c222960eba3b8e9275fd1f5acb942278180c8b613d8ffc0d983333f059ea8a
|
7
|
+
data.tar.gz: a1800a9b27c769adbae11bc8e3f08e5d57d15b3b345d19acbd329142048e742acab8878328e3c8a9053a957c3c27ecf14cd067848d1bc056f552386243c33730
|
data/lib/list_spider.rb
CHANGED
data/lib/spider_base.rb
CHANGED
@@ -7,6 +7,7 @@ require "addressable/uri"
|
|
7
7
|
|
8
8
|
class TaskStruct
|
9
9
|
def initialize(href, local_path, http_method: :get, params: {}, extra_data: nil, parse_method: nil)
|
10
|
+
@origin_href = href
|
10
11
|
@href = href
|
11
12
|
if @href.class == "".class
|
12
13
|
@href = SpiderHelper.string_to_uri(@href)
|
@@ -22,7 +23,7 @@ class TaskStruct
|
|
22
23
|
o.class == self.class && o.href == href && o.local_path == local_path && o.http_method == http_method && o.params == params && o.extra_data == extra_data
|
23
24
|
end
|
24
25
|
|
25
|
-
attr_accessor :href, :local_path, :http_method, :params, :extra_data, :parse_method
|
26
|
+
attr_accessor :origin_href , :href, :local_path, :http_method, :params, :extra_data, :parse_method
|
26
27
|
|
27
28
|
end
|
28
29
|
|
@@ -112,6 +113,7 @@ module SpiderBase
|
|
112
113
|
}
|
113
114
|
w.errback {
|
114
115
|
puts "errback:#{w.response_header}"
|
116
|
+
puts e.origin_href
|
115
117
|
puts e.href
|
116
118
|
puts w.response_header.status
|
117
119
|
failed_list << e
|