2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

(win)Pythonでsqlite3を用いてFirefoxの履歴を取得する(個人メモ)

Last updated at Posted at 2019-03-20
GetHistory_Firefox.py
#<sqlite3>ライブラリをインポート
import sqlite3

#Firefoxの履歴が保存されているsqliteファイルを指定(◆◆◆は各自で変更)
conn = sqlite3.connect("C:\\Users\\◆◆◆\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\◆◆◆\\places.sqlite")

# データベース接続とカーソル生成
cur = conn.cursor()

#executeを用いてSqlite3のコマンドを実行
#places.sqlite内のmoz_placesの項目にid,url,title,他・・・と列で並んで保存されている。
cur.execute("select * from moz_places")

#履歴に保存されている全てのTitleとURLを表示
for row in cur:
	print(row[2],row[1],)#Tile,URL
2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?