borisbabic / browser_cookie3

This is a fork of browser_cookie
GNU Lesser General Public License v3.0
856 stars 144 forks source link

In version 0.18.0, I am unable to read the cookie folder associated with the currently logged-in Chrome account. It throws a permission error. #179

Closed zhaotong1121 closed 1 year ago

zhaotong1121 commented 1 year ago

Here is the exception stack trace information.

Traceback (most recent call last): File "D:\PyCharm 2022.2.1\plugins\python\helpers\pydev\pydevd.py", line 1496, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "D:\PyCharm 2022.2.1\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "D:/code/pythonOfVue/generalTxt.py", line 120, in get_cookie() File "D:/code/pythonOfVue/generalTxt.py", line 106, in get_cookie jc = browser_cookie3.chrome(domain_name=url) File "C:\Users\zhaot.virtualenvs\tradeCenterNx-kx4xaHRg\lib\site-packages\browser_cookie3__init.py", line 973, in chrome return Chrome(cookie_file, domain_name, key_file).load() File "C:\Users\zhaot.virtualenvs\tradeCenterNx-kx4xaHRg\lib\site-packages\browser_cookie3__init__.py", line 387, in load con = _sqlite3_connect_readonly(self.cookie_file) File "C:\Users\zhaot.virtualenvs\tradeCenterNx-kx4xaHRg\lib\site-packages\browser_cookie3\init__.py", line 145, in _sqlite3_connect_readonly con = sqlite3.connect(uri + options, uri=True) sqlite3.OperationalError: unable to open database file

darthwalsh commented 1 year ago

@zhaotong1121 maybe this should be closed as a duplicate of #180? (even though this issue was created first.)

If you can't manually make a copy of %LOCALAPPDATA%\Google\Chrome\User Data\Default\Network\Cookies file because chrome is open, it's the same root cause.

rafiibrahim8 commented 1 year ago

@darthwalsh Yeah. People are commenting on the other issue.