Any ideas? Casperjs did not render page completely.

44 views
Skip to first unread message

ansvv...@gmail.com

unread,
Mar 17, 2017, 9:59:21 AM3/17/17
to CasperJS
I tried to visit the webpage and capture with casperjs, but nothing showed in .png and no final html DOMs generated.(Page works perfectly in chrome browser)  

And code:

var casper = require('casper').create({
    verbose: true,
    logLevel: 'debug'
});
casper.start("http://m.weibo.cn/status/Er9b7wxsD", function() {
        this.wait(5000, function() {
            this.scrollTo(0, 0);
            this.echo(this.getHTML('html', true));
            this.capture('all.png');
        });

});
casper.run();

Any idea is very much appreciated and thanks in advance!

ansvv...@gmail.com

unread,
Mar 17, 2017, 10:01:02 AM3/17/17
to CasperJS
I'm using: 
CasperJS version 1.1.2
phantomjs version 2.1.1

在 2017年3月17日星期五 UTC+8下午9:59:21,ansvv...@gmail.com写道:

Khmer Kavey

unread,
Mar 18, 2017, 9:55:18 AM3/18/17
to CasperJS
you can't scroll to end of page.
because it use lazy loader.

ansvv...@gmail.com

unread,
Mar 18, 2017, 8:30:54 PM3/18/17
to CasperJS
Thanks for your kindly reply, Kavey. I commented the scrolling action and get the same results. 
Maybe Casperjs or phantomjs can not render some kind of elements or actions  in the webpage. 

在 2017年3月18日星期六 UTC+8下午9:55:18,Khmer Kavey写道:

Ken

unread,
May 25, 2017, 9:48:29 AM5/25/17
to CasperJS
How about this.scrollToBottom or sending many down arrow keys to the page to force a refresh? 

Ken

unread,
May 28, 2017, 10:03:04 PM5/28/17
to CasperJS
Reply all
Reply to author
Forward
0 new messages