fixed error on Casper#captureSelector and Casper#fill
Showing
2 changed files
with
4 additions
and
3 deletions
... | @@ -130,7 +130,7 @@ | ... | @@ -130,7 +130,7 @@ |
130 | * @return Casper | 130 | * @return Casper |
131 | */ | 131 | */ |
132 | captureSelector: function(targetFile, selector) { | 132 | captureSelector: function(targetFile, selector) { |
133 | return this.capture(targetFile, self.evaluate(function() { | 133 | return this.capture(targetFile, this.evaluate(function() { |
134 | try { | 134 | try { |
135 | return document.querySelector(selector).getBoundingClientRect(); | 135 | return document.querySelector(selector).getBoundingClientRect(); |
136 | } catch (e) { | 136 | } catch (e) { |
... | @@ -332,7 +332,7 @@ | ... | @@ -332,7 +332,7 @@ |
332 | } | 332 | } |
333 | // Form submission? | 333 | // Form submission? |
334 | if (submit === true) { | 334 | if (submit === true) { |
335 | self.evaluate(function() { | 335 | this.evaluate(function() { |
336 | var form = document.querySelector('%selector%'); | 336 | var form = document.querySelector('%selector%'); |
337 | console.log('submitting form to ' + (form.getAttribute('action') || "unknown") | 337 | console.log('submitting form to ' + (form.getAttribute('action') || "unknown") |
338 | + ', HTTP ' + (form.getAttribute('method').toUpperCase() || "GET")); | 338 | + ', HTTP ' + (form.getAttribute('method').toUpperCase() || "GET")); | ... | ... |
... | @@ -12,7 +12,8 @@ function getLinks() { | ... | @@ -12,7 +12,8 @@ function getLinks() { |
12 | 12 | ||
13 | var links = []; | 13 | var links = []; |
14 | var casper = new phantom.Casper({ | 14 | var casper = new phantom.Casper({ |
15 | logLevel: "info", // we only want "info" or higher level log messages | 15 | faultTolerant: false, |
16 | logLevel: "debug", // we only want "info" or higher level log messages | ||
16 | loadImages: false, // do not download images to save bandwidth | 17 | loadImages: false, // do not download images to save bandwidth |
17 | loadPlugins: false, // do not load plugins to save kitten | 18 | loadPlugins: false, // do not load plugins to save kitten |
18 | verbose: true // write log messages to the console | 19 | verbose: true // write log messages to the console | ... | ... |
-
Please register or sign in to post a comment