SHARE
TWEET

Python - sqlite - firefox cookies and history

furas Jun 22nd, 2018 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import sqlite3
  2. import os
  3. import os.path
  4.  
  5. # user's home folder
  6. HOME = os.path.expanduser('~')
  7.  
  8. # firefox default profile folder
  9. FIREFOX_PATH = os.path.join(HOME, '.mozilla/firefox/mwad0hks.default/')
  10.  
  11. print('--- cookies ---')
  12.  
  13. con = sqlite3.connect(os.path.join(FIREFOX_PATH, 'cookies.sqlite'))
  14. results = con.execute('SELECT * FROM moz_cookies')
  15.  
  16. for row in results:
  17.     print(row)
  18.  
  19. print('--- places (bookmarks/history) ---')
  20.  
  21. con = sqlite3.connect(os.path.join(FIREFOX_PATH, 'places.sqlite'))
  22. results = con.execute('SELECT * FROM moz_places')
  23.  
  24. for row in results:
  25.     print(row[1])
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top