Casper JS - facebook page loading without content, only header

39 views
Skip to first unread message

Miguel Poegel

unread,
Oct 8, 2017, 6:21:27 PM10/8/17
to CasperJS
var casper = require('casper').create({
  verbose
: false,
  logLevel
: 'debug',
  defaultWaitForTimeout
: 60000,
  pageSettings
: {
    loadImages
: true,
    loadPlugins
: true,
    userAgent
: 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0'
 
},
  clientScripts
: ['../jquery.js']
});

casper
.options.viewportSize = {width: 1900, height: 1000};
casper
.options.waitTimeout = 60000;

var utils = require('utils');
var numbers = [];

casper
.start('https://www.facebook.com/', function () {

 
this.then(function () {
   
this.captureSelector("1_page.png", "html");
  });

});

I have a cookie file where I am already logged in, starting casperJS like this: "casperjs --ssl-protocol=any --cookies-file=cookies.txt --web-security=no facebook.js" and as you can see at the attached screenshot, the page loads and already logged in but all the dynamic content does NOT load...

I already tryed with "this.wait" for more then 60 seconds to wait the page loading and nothing...

Please help,
Thanks
1_page.png

Ken Soh

unread,
Dec 10, 2017, 11:56:44 AM12/10/17
to CasperJS
I suspect it is most likely facebook detecting automated browser and trying to block your automation. You can try other tools such as puppeteer or nightmarejs to see if that works for you.

Miguel Poegel

unread,
Dec 11, 2017, 12:47:10 AM12/11/17
to casp...@googlegroups.com
Thanks man, I fixed it long time ago using slimerjs engine on casperjs!

Thanks a lot for your reply really appreciated it!

If you want to do projects together let me know 


--
CasperJS homepage & documentation: http://casperjs.org/
CasperJS @github: https://github.com/n1k0/casperjs
 
You received this message because you are subscribed to the Google Groups "casperjs" group.
Visit this group at http://groups.google.com/group/casperjs?hl=en.
---
You received this message because you are subscribed to a topic in the Google Groups "CasperJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/casperjs/AqqCTb1Afpc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to casperjs+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages