xenial-black
xenial-black5mo ago

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
Hall5mo 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
Louis Deconinck5mo ago
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
xenial-black
xenial-blackOP5mo ago
is there any data being persisted between sessions? the session object has got cookies in it
luigi.ruocco
luigi.ruocco5mo 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?