How to delete a certain IE cookie from python?
how 开发者_JAVA百科can I delete IE 8 cookies for a certain site from Python?
It is probably cleaner and less error prone to use the Python standard library module: cookielib this provides functions to manipulate cookies in various ways.
Unfortunately to use this with IE consider the third party extension to this module: Client Cookie. This module contains various "cookie jars" such as MSIECookieJar
which is what you probably want but also MozillaCookieJar
. This module does not necessarily work with all version of IE but is worth a look.
I've found out that under Windows seven cookies are stored in
C:\Users(user)\AppData\Roaming\Microsoft\Windows\Cookies
in format (user)@host[\d].txt, so I guess just deleting the corresponding file is way to go.
精彩评论