klepto 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/klepto.rb +1 -1
- data/lib/klepto/bot.rb +4 -2
- data/lib/klepto/browser.rb +3 -4
- data/lib/klepto/version.rb +1 -1
- metadata +2 -2
data/lib/klepto.rb
CHANGED
data/lib/klepto/bot.rb
CHANGED
@@ -31,15 +31,17 @@ EOS
|
|
31
31
|
# Structure all the pages
|
32
32
|
def __process!
|
33
33
|
@structure = nil
|
34
|
+
@browser.set_driver @config.driver || :poltergeist
|
34
35
|
@browser.set_headers @config.headers
|
35
|
-
|
36
|
-
|
36
|
+
|
37
37
|
@config.before_handlers[:get].each { |bh|
|
38
38
|
bh.call(@browser,@config.url)
|
39
39
|
}
|
40
40
|
|
41
41
|
begin
|
42
42
|
@browser.fetch! @config.url
|
43
|
+
#@browser.page.driver.restart
|
44
|
+
#@browser.page.driver.quit #rescue nil
|
43
45
|
|
44
46
|
# Fire callbacks on GET
|
45
47
|
@config.after_handlers[:get].each do |ah|
|
data/lib/klepto/browser.rb
CHANGED
@@ -8,8 +8,8 @@ module Klepto
|
|
8
8
|
super
|
9
9
|
end
|
10
10
|
|
11
|
-
def set_driver(
|
12
|
-
@use_driver =
|
11
|
+
def set_driver(using_driver)
|
12
|
+
@use_driver = Capybara.current_driver = Capybara.javascript_driver = using_driver
|
13
13
|
end
|
14
14
|
|
15
15
|
def use_driver
|
@@ -55,9 +55,8 @@ module Klepto
|
|
55
55
|
|
56
56
|
def fetch!(_url)
|
57
57
|
@url_to_structure = _url
|
58
|
-
Klepto.logger.debug("Fetching #{@url_to_structure}")
|
58
|
+
Klepto.logger.debug("Fetching (#{@use_driver}) #{@url_to_structure}")
|
59
59
|
|
60
|
-
Capybara.current_driver = Capybara.javascript_driver = use_driver
|
61
60
|
visit @url_to_structure
|
62
61
|
page
|
63
62
|
end
|
data/lib/klepto/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: klepto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: poltergeist
|