Skip to content

Instantly share code, notes, and snippets.

@shantanuo
Created June 4, 2020 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shantanuo/6a99afc87d83597c1d0a50f7d6d3c110 to your computer and use it in GitHub Desktop.
Save shantanuo/6a99afc87d83597c1d0a50f7d6d3c110 to your computer and use it in GitHub Desktop.
Extract google search history
import pandas as pd
import json
with open("BrowserHistory.json", "r") as read_file:
developer = json.load(read_file)
df = pd.DataFrame(developer["Browser History"])
df["UNIXTIME"] = pd.to_datetime(df["time_usec"], unit="us")
df = df.sort_values("UNIXTIME")
ndf = df[
(df["favicon_url"] == "https://www.google.com/favicon.ico")
& (df["page_transition"] == "LINK")
& (df["UNIXTIME"] > "2020-06-01 09:40:00")
& (df["UNIXTIME"] < "2020-06-01 19:40:00")
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment