python可以访问google chrome webSQL数据库吗
我有一个本地web客户端,它使用webSQL存储其客户端的数据。(是的,我知道它已经被弃用了) 我还有一个python脚本,它生成一个报告,并使用驱动程序从mdb文件中获取其数据 我想知道是否有可能通过python从google chrome的webSQL数据库中获取我的数据 我不知道如何从python脚本调用google chrome中的一个db文件,或者是否可能python可以访问google chrome webSQL数据库吗,python,sqlite,google-chrome,web-sql,Python,Sqlite,Google Chrome,Web Sql,我有一个本地web客户端,它使用webSQL存储其客户端的数据。(是的,我知道它已经被弃用了) 我还有一个python脚本,它生成一个报告,并使用驱动程序从mdb文件中获取其数据 我想知道是否有可能通过python从google chrome的webSQL数据库中获取我的数据 我不知道如何从python脚本调用google chrome中的一个db文件,或者是否可能 任何帮助都将不胜感激 我希望我正确理解了你的问题: Chrome UserData文件夹中有趣的文件(至少在Windows中是这样
任何帮助都将不胜感激 我希望我正确理解了你的问题: Chrome UserData文件夹中有趣的文件(至少在Windows中是这样称呼的)是afaik JSON文件或SQLite数据库文件。您可以使用Python标准库中的来访问后者。 但自述文件指出:
Google Chrome settings and storage represent user-selected preferences and
information and MUST not be extracted, overwritten or modified except through
Google Chrome defined APIs.
好吧,我的同事想出来了 在windows上,您可以转到:
C:\Users\<UserName>\AppData\Local\Google\Chrome\User Data\Default\databases
C:\Users\\AppData\Local\Google\Chrome\User Data\Default\databases
这里有一组数据库用于使用sqlite的不同网站
然后,python脚本与此一样简单:
import sqlite3
conn = sqlite3.connect(<dbFile>)
cursor = conn.cursor()
print "\nHere's a listing of all the records in the table:\n"
for row in cursor.execute("SELECT * FROM <TableName>"):
print row
导入sqlite3
conn=sqlite3.connect()
游标=连接游标()
打印“\n这是表中所有记录的列表:\n”
对于游标中的行,执行(“选择*自”):
打印行
嘿,谢谢你的回复。我们似乎意见一致。我尝试过使用sqlite3模块。问题是我不知道如何在谷歌浏览器中引用这些文件。我的同事实际上刚刚想出了答案,我很快就会发布答案。啊!您正在查找数据库所在的文件夹。我误解了。