Commit de1a0348 de1a0348bcf5b63021914958e8f1fbded16a6908 by Nicolas Perriault

fixed error on Casper#captureSelector and Casper#fill

1 parent ad4f403f
...@@ -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
......