如何使用 Python 显示 Google Chrome sqlite3 "cookie" 数据库中的主机



我使用Python访问"cookie"chrome sqlite3db来检索主机密钥,但在以下出现错误

import sqlite3
conn = sqlite3.connect(r"C:UserstikkaAppDataLocalGoogleChromeUser DataDefaultCookies")
cursor  = conn.cursor()
cursor.execute("select host_key from cookies")
results = cursor.fetchall()
print results
conn.close()

错误

Traceback (most recent call last):
  File "C:Python27cookies.py", line 4, in <module>
    cursor.execute("select host_key from cookies")
DatabaseError: malformed database schema (is_transient) - near "where": syntax error
>>> 
由于alecxe提供的链接,

能够通过将sqlite3版本从3.6.21升级到3.9.2来修复它。我通过从这个网站下载新版本并将dll放在C:\Python27\DLLs

中进行了升级

最新更新