Searching chrome history by date

broken image
broken image

Get_url = list(cursor.execute('''SELECT url from urls'''))Ĭrf = open ('/Users/someuser/Documents/tmp/cr/cr_hist.txt','w' ) Get_time = list(cursor.execute('''SELECT last_visit_time FROM urls''')) Here's the function : It assumes that the Chrome history file has been copied from another account into /Users/someuser/Documents/tmp/Chrome/History def getcr():Ĭonnection = nnect('/Users/someuser/Documents/tmp/Chrome/History')

broken image
broken image

This may not be the most Pythonic code in the world, but here's a solution: Cheated by adjusting for time zone (EST here) by doing this: utctime = datetime.datetime(1601,1,1) + datetime.timedelta(microseconds = ms, hours =-5) Of course Opster can be thrown out but seems handy to me :-) chrome-tools.py import-history ~/.config/chromium/Default/History* > history.txt Urls = (row for row in c.execute(SQL_URL)) Times = (row for row in c.execute(SQL_TIME)) Return epoch_start + import_history(*paths): SQL_URL = 'SELECT c0url FROM pages_content'Įpoch_start = datetime.datetime(1601,1,1)ĭelta = datetime.timedelta(microseconds=int(webkit_timestamp)) This is a more pythonic and memory-friendly way to do what you described (by the way, thanks for the initial code!): #!/usr/bin/env python