username123
username123

Reputation: 983

How can I get the data from LocalStorage of a Chrome extension using Python?

I am using TimeStats extension on Chrome. And what I want to do now is to read the data in the LocalStorage (which contains all the information about the time I spent on each website) in a Python script and do later data processing.

I know that Ctrl+c and Ctrl+v would work in this case, but I am wondering are there any elegent and reliable ways to do that?

Thanks!

Upvotes: 1

Views: 2245

Answers (1)

rsanchez
rsanchez

Reputation: 14657

You can use native messaging to send data between your extension and an external app. The sample app for demonstrating native messaging is written in Python, so you have the communications part already solved.

EDIT:

I see now that you are talking about an extension you don't own. Google Chrome currently stores LocalStorage data in SQLite format, so you should be able to read it directly using the sqlite3 package. See the answers to this question.

The file for the timeStats extension would be chrome-extension_ejifodhjoeeenihgfpjijjmpomaphmah_0.localstorage

Note that Google can change the way of storing LocalStorage at any time.

Upvotes: 1

Related Questions