How to clear cookies?
I need to clear the cookies for a website before requesting it using the CheerioCrawler, how do I do it? TIA
4 Replies
Someone will reply to you shortly. In the meantime, this might help:
-# This post was marked as solved by Matous. View answer.
By default when requesting a page using CheerioCrawler, no cookies are being sent. So, there's nothing to do.
If you want to set or change cookies you can do that with
preNavigationHooks
.
Documentation: https://crawlee.dev/js/api/browser-crawler/interface/BrowserCrawlerOptions#preNavigationHookslike-goldOP•4w ago
is there any data being persisted between sessions? the session object has got cookies in it
optimistic-gold•4w ago
Sessions are persisted on the key-values store by default, if you need to access them. When created new the sessions are based on the options passed on the
sessionOptions
, if there is no indication everything is in a blank state with default options.
See here for more informations: https://crawlee.dev/js/docs/guides/session-management