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
Hall
Hall4w ago
Someone will reply to you shortly. In the meantime, this might help: -# This post was marked as solved by Matous. View answer.
Louis Deconinck
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#preNavigationHooks
like-gold
like-goldOP4w ago
is there any data being persisted between sessions? the session object has got cookies in it
optimistic-gold
optimistic-gold4w 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

Did you find this page helpful?