Skip to content

Instantly share code, notes, and snippets.

@lithuak
Last active January 6, 2018 21:20
Show Gist options
  • Save lithuak/6907041 to your computer and use it in GitHub Desktop.
Save lithuak/6907041 to your computer and use it in GitHub Desktop.
Export cookies from Chrome db to Scrapy format
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