Live data from Hacker News

Analyzing Your Browser History Using Python and Pandas

applecrazy.github.io

1–10 of 42 posts

Re: Analyzing Your Browser History Using Python and Pandas

#3

Vivaldi does this for me in the history page itself. Pretty weird to use Python just to see a distribution of what sites you visited. Iirc stock chrome also has a way to view this.

Author of the post here.

The main purpose of the post was to demonstrate collection and cleaning of data and give an overview of it through a basic visualization.

In the future, I'd like to show how this data is a gold mine of information, using it to predict browsing trends, create a profile of interests, and more.

Mainly to show why ad tracking/selling of user browser history is bad, but also to teach some data science techniques along the way.

Re: Analyzing Your Browser History Using Python and Pandas

#5
post #4

> Since Pandas probably doesn’t do this out of the box It does, use df[column_name].str.split(expand=True), where df is your DataFrame.

I had pipe symbols in URLs. Will it split only on the first pipe symbol?

Edit: nevermind, it does do that (https://pandas.pydata.org/pandas-docs/stable/generated/panda...)

Re: Analyzing Your Browser History Using Python and Pandas

#6
post #4

> Since Pandas probably doesn’t do this out of the box It does, use df[column_name].str.split(expand=True), where df is your DataFrame.

I had pipe symbols in URLs. Will it split only on the first pipe symbol? Edit: nevermind, it does do that ( https://pandas.pydata.org/pandas-docs/stable/generated/panda... )

Why do you mind? You throw away the rest of the URL in the next step anyway. :-)

Re: Analyzing Your Browser History Using Python and Pandas

#7
Great post for a quick read! You could maybe have taken your google searches from within the URL and Stack Overflow question titles and done word frequency analysis and maybe learned what languages you code in most often/what type of problems you have most as well. Good intro for a quick read though.

Re: Analyzing Your Browser History Using Python and Pandas

#8
It seems a bit odd to export the data in the command line to then work with it in pandas, given that it's a stock sqlite3 database. I'd just use sqlite3.connect and pd.read_sql_query directly. (I know, the db will be locked when Chrome is running, but you can always shutil.copy it to a temp location.)
Post reply on HN