Skip to content

Instantly share code, notes, and snippets.

@akdh
Created July 16, 2014 22:09
Show Gist options
  • Save akdh/214f1d54fd714b8f2368 to your computer and use it in GitHub Desktop.
Save akdh/214f1d54fd714b8f2368 to your computer and use it in GitHub Desktop.
Read from Sqlite3 DB
import sqlite3
url = “"
conn = sqlite.connect('fetch.db')
db = conn.curson()
db.execute("SELECT response FROM urls WHERE url = ?", (url,))
response = db.fetchone()[0]
index = response.find('\n\n\n’)
body = response[index+3:]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment