CasperJS: ¿Por qué mi URL cambia a aproximadamente: en blanco cuando se carga mi página?
Soy un principiante en PhantomJS / CasperJS.
Solo quiero comenzar una sesión y verificar que esté bien.
Aquí está mi código:
var casper = require('casper').create({
verbose: true,
logLevel: 'debug',
pageSettings: {
loadImages: false,
loadPlugins: false,
userAgent: 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0'
}
});
casper.on('remote.message', function(msg) {
this.echo('remote message caught: ' + msg);
});
casper.on("page.error", function(msg,trace) {
this.echo("Page Error: " + msg, "ERROR");
});
casper.start('https://www.google.fr');
casper.then(function(){
console.log('Page Loaded');
this.test.assertTitle('Google', 'Welcome to Google');
});
casper.run();
Cuando ejecuto este script simple, obtengo:
C:\Users\Booky\Documents\nike_project>casperjs --ignore-ssl-errors=true --ssl-protocol=tlsv1 debug.js
C:\Users\Booky\Documents\nike_project>[info] [phantom] Starting...
[info] [phantom] Running suite: 3 steps
[debug] [phantom] opening url: https://www.google.fr/, HTTP GET
[debug] [phantom] Navigation requested: url=https://www.google.fr/, type=Other, willNavigate=true, isMainFrame=true
[debug] [phantom] url changed to "https://www.google.fr/"
[debug] [phantom] Successfully injected Casper client-side utilities
[debug] [phantom] start page is loaded
[info] [phantom] Step anonymous 3/3 https://www.google.fr/ (HTTP 200)
Page Loaded
[debug] [phantom] Navigation requested: url=about:blank, type=Other, willNavigate=true, isMainFrame=true
[debug] [phantom] url changed to "about:blank"
Busqué en todas partes y no he encontrado ninguna respuesta a mi problema.
AmbientePhantomJS 2.1.1CasperJS 1.1.0beta5