preface

Let’s take a quick look at Chrome’s web browsing history using Python.

The development tools

Python version: 3.6.4
Related modules:

Pyecharts module;

Wordcloud module;

And some modules that come with Python.

** db. Browser version: **3.11.0

Environment set up

About python:

Install Python and add it to the environment variables. PIP installs the required related modules.

About the DB. The Browser:

Download address:

https://github.com/sqlitebrowser/sqlitebrowser/releases
Copy the code

It is recommended to download the installation-free version (the installation-free version is also provided in the relevant files).

Introduction of the principle

Chrome’s web browsing history is generally saved in:

C:\Users<USERNAME>\AppData\Local\Google\Chrome\UserData\Default\history

Open it with db. Browser and find urls and visits related to history:

Look at the structure of the table:

Now that we know the structure of the table, we can happily write code to extract the browsing history:

The obtained data are simply visualized, and the results are as follows:

My daily share of Python data crawler case, the next article to share Python monitoring bitcoin price trend

All done~ Complete source code see personal profile or private letter to obtain relevant files.