Selenium Webdriver: Delete Cookies On All Domains

后端 未结 2 1318
陌清茗
陌清茗 2021-02-20 01:04

In selenium you can only delete cookies on the current domain, but would it be possible to navigate to the file where Firefox is storing the cookies and either delete the file o

相关标签:
2条回答
  • 2021-02-20 01:16

    Selenium doesn't store the cookies, the browser does. So the answer to "where [the browser] stores the cookies" will be different for each browser. But since Selenium always starts the browser with a clean profile, you shouldn't have to do this - there are no cookies when the browser starts.

    0 讨论(0)
  • 2021-02-20 01:22

    You can specify a user directory and then manipulate <userdir>/Default/Cookies. This question is similar: Getting or Manipulating all cookies in Selenium Webdriver

    0 讨论(0)
提交回复
热议问题