Last active
January 6, 2018 21:20
-
-
Save lithuak/6907041 to your computer and use it in GitHub Desktop.
Export cookies from Chrome db to Scrapy format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
def get_chrome_cookies(): | |
conn = sqlite3.connect('/home/<username>/.config/chromium/Default/Cookies') | |
query = 'select name, value, path from cookies where host_key=".livejournal.com";' | |
return [{"name": r[0], "value": r[1], "path": r[2]} for r in conn.execute(query)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment