Skip to content

Instantly share code, notes, and snippets.

@ids1024
Created November 1, 2017 20:40
Show Gist options
  • Save ids1024/4cb366c2812772a3123ce4141e8adaa6 to your computer and use it in GitHub Desktop.
Save ids1024/4cb366c2812772a3123ce4141e8adaa6 to your computer and use it in GitHub Desktop.
import sqlite3
import urllib.parse
DOMAIN = 'google.com'
conn = sqlite3.connect("History")
c = conn.cursor()
c.execute("SELECT url FROM urls;")
urls = c.fetchall()
print(*set(i for i in (urllib.parse.urlparse(i[0]).netloc for i in urls) if i.endswith('.' + DOMAIN)), sep='\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment