HENNGE / arsenic

Async WebDriver implementation for asyncio and asyncio-compatible frameworks
Other
349 stars 52 forks source link

Any way to delete all cookies or cache? #131

Closed DiMiTriFrog closed 2 years ago

DiMiTriFrog commented 2 years ago

I'm trying to start new browser each time without cookies (if I start without cache the load time is too high). Selenium have options like driver.delete_all_cookies()

Any execution similar to do this? or Any way to put preferences like -> "network.cookie.cookieBehavior", 2 ?

Thank you!

dimaqq commented 2 years ago

WebDriver has this method, so it should be possible https://www.w3.org/TR/webdriver/#delete-all-cookies

DiMiTriFrog commented 2 years ago

WebDriver has this method, so it should be possible

https://www.w3.org/TR/webdriver/#delete-all-cookies

And how can I do it??

I do it, for delete cookies -> await session.delete_all_cookies() And for delete cache you can set the directory cache as an argument -> "--user-data-dir=/tmp/user-data/cachepath" and on finish the session delete this path.