Apify Discord Mirror

Updated 6 hours ago

How can I pass context to createNewSession ?

I want to use existing crawler setting (JSON/ cherioo ) upon creating new session, signing in / signing up user there while associating cookies, token with the session.

Currently I put these new session creation conditionally inside preNavigation hook (context is passed as arg there), but not in createNewSession
V
R
2 comments
This to give better DX when scraping protected websites where we need to:
  • sign in
  • maintain browser history
  • maintain cookies and token
  • 1 proxy, 1 auth per session
Hey, information like cookies/tokens becomes available after you visit the site, so you can update the information stored in the session in the request handler once it's accessible
Add a reply
Sign up and join the conversation on Discord