1

I had been confusing for several days about using cookies with Casperjs. I need to get the HTML,which is generated by JavaScript and it also need user login.So I tried to use Casperjs. I tried to use Mylogin.js to login the website and get cookies to use afterwards.

casperjs.bat --cookies-file=cookie.txt --web-security=false Mylogin.js

Then I need to use GetHTML.js with cookies to visit some pages that need the user login.

casperjs.bat --cookies-file=cookie.txt --web-security=false GetHTML.js

But it seems that the cookies didn't work,it still need me login.I also tried to write cookies to file,and there isn't any help.

I Google it,read the document but no help.Need your help.Thanks

=====================================

Really thanks,I should the bin/casperjs.exe ,it works.

Tracy Da
  • 325
  • 1
  • 2
  • 7
  • What is your CasperJS version? A couple of years ago there was an error that prevented CLI arguments from being passed from CasperJS to PhantomJS. Nowadays (version 1.1-beta3) there's casperjs.exe in bin folder that you should use. – Vaviloff Nov 18 '15 at 06:10
  • http://stackoverflow.com/a/16954187/502860 – iimos Nov 18 '15 at 07:38

0 Answers0