Search code examples
authenticationweb-scrapingcasperjs

CasperJS using external cookies to login into site


I am using CasperJS to create a tool that needs to scrap information accessible only after login, which requires captcha verification.

If the user is not logged in, instead of the requested page the site will display the login page.

Is it possible to login manually in browser, save the cookie and pass this to CasperJS script? My goal is that the script would look like logged in and so the page will be displayed without login request.


Solution

  • You can't do it

    If the site is implemented correctly it will save your cookie as a HTTP-only which you can't access in browser. Imagine if this was possible, everyone could (with very little investigation time) spoof cookie and access the system.