简体   繁体   English

Python/Selenium - 清除我的 chrome 网络驱动程序中的 cookies?

[英]Python/Selenium - Clear the cookies in my chrome webdriver?

I'm trying to clearcookies in my chrome browser (webdriver from selenium) but I can't find any solutions for specifically the chrome driver.我正在尝试在我的 chrome 浏览器(来自 selenium 的 webdriver)中清除 cookies,但我找不到任何专门针对 chrome 驱动程序的解决方案。 How do I clear the cache and cookies in Python? Python中的缓存和cookies如何清除?

import undetected_chromedriver.v2 as uc
if __name__ == '__main__':
    driver = uc.Chrome()
    dar_like()
    driver.delete_all_cookies()
    driver.get('https://www.google.com') 

Cookies and cache are never saved unless you set a profile in options or manually save them via pickle etc. Cookies 和缓存永远不会保存,除非您在选项中设置配置文件或通过 pickle 等手动保存它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM