casperjs phantomjs any waitging function makes crash on Angular website

17 views
Skip to first unread message

Andrzej Blukis

unread,
Dec 21, 2017, 9:13:51 AM12/21/17
to CasperJS
Hello
For a last few days i'm tring to get some data using phantomjs and casperjs from this webpage:
https://www.mcourser.pl/accounts/login
(it is build on Angular)

My goal is to log-in and navigate through resources to some interesting me data but i have stuck on very simple task:

var casper = require('casper').create();
casper.start('https://www.mcourser.pl/accounts/login');
casper.capture('screen.png');
casper.run();

the screenshot gives me only image of spinning circle meaning that webbpage is loading.
any tries to force the script to wait for anything (functioins wait(), waitForSelector(), ...) crashes the casperjs/phantomjs giving error: memory access violation

What am i doing wrong?

Ken Soh

unread,
Jan 10, 2018, 11:04:42 PM1/10/18
to CasperJS
You may want to try putting the actions inside then block (from casperjs homepage). You can also try posting your sample scripts which crash here so others can try running on their instances.

var casper = require('casper').create();

casper.start('http://casperjs.org/');

casper.then(function() {
    this.echo('First Page: ' + this.getTitle());
});

casper.thenOpen('http://phantomjs.org', function() {
    this.echo('Second Page: ' + this.getTitle());
});

casper.run();

A framework that I made was able to run ok and it is based on CasperJS. Below the script for TagUI framework and the snapshot.
Reply all
Reply to author
Forward
0 new messages