Skip to content

Instantly share code, notes, and snippets.

View lithuak's full-sized avatar

Ilya Persky lithuak

  • Ukraine
View GitHub Profile
@lithuak
lithuak / lj_spider.py
Last active January 6, 2018 21:20
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)]