Python Forum
Coding a logger for firefox history
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Coding a logger for firefox history
#1
i am very new to coding and dont have any experience, so i would like to ask if someone can help or direct me somewhere where i can learn. i want to know if there is one already in existence or if there is a way to write a small program in python that would log all internet history on the go or at least at certain intervals. i know that firefox stores it, but it can be easily deleted. i need to write one that will store it on the computer in a text or whatever other format file. if someone can help me out, i would greatly appreciate it.
Reply
#2
For tutorials, here's two of my favorites:

python 3: Think like a computer scientist (pdf): https://media.readthedocs.org/pdf/howtot...othink.pdf
or:
python 3 tutorial: https://greenteapress.com/wp/think-python-2e/

to find packages: https://pypi.org/

not recommended (python 2 is nearing End of Life): http://www.greenteapress.com/thinkpython...ython.html
Reply
#3
(Dec-24-2018, 06:06 PM)kpiatrou Wrote: is a way to write a small program in python that would log all internet history on the go or at least at certain intervals. i know that firefox stores it, but it can be easily deleted.
Can store places.sqlite in a schedule to have backup.
Quote:The file "places.sqlite" stores the annotations, bookmarks, favorite icons, input history, keywords, and browsing history (a record of visited pages).
If doing schedule with Python and not from OS,is Python job scheduling for humans fine to use.

As it's a sqlite database file,can access it to query more specific data.
Example for me on Windows:
import sqlite3

db = sqlite3.connect(r"C:\Users\Tom\AppData\Roaming\Mozilla\Firefox\Profiles\tfzfhcx7.default-1393951771719-1522289122174\places.sqlite")
all_urls = db.execute("select url from moz_places").fetchall()
last_10_visit = db.execute("select url from moz_places order by id desc limit 10").fetchall()
visit_count = db.execute("select url from moz_places order by visit_count desc limit 10").fetchall() 
Output:
>>> last_10_visit [('https://pypi.org/',), ('https://pypi.python.org/',), ('https://www.python.org/dev/peps/pep-0008/',), ('https://www.python.org/',), ('https://www.google.com/search?client=firefox-b-ab&q=pythpon+',), ('http://amk.ca/python/howto/regex/',), ('https://repl.it/languages',), ('http://www.pressfire.no/',), ('https://itavisen.no/',), ('http://itavisen.no/',)]
Can store wanted data to own database,using easier DB tool like TinyDB or dataset(my tutorial).
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Build a DNS History Rudeus 2 627 Aug-11-2023, 09:52 PM
Last Post: Rudeus
  why is yfinance returning an ellipsis in the middle of ticket history db042190 3 971 Jun-12-2023, 06:03 PM
Last Post: db042190
  logger behaviour setdetnet 1 887 Apr-15-2023, 05:20 AM
Last Post: Gribouillis
  how to write exception error into logger mg24 3 979 Nov-15-2022, 04:20 PM
Last Post: insharazzak
  python insert blank line in logger mg24 1 2,831 Nov-02-2022, 08:36 AM
Last Post: snippsat
  python logger help ... save logger into different folder mg24 1 1,447 Oct-25-2022, 03:04 PM
Last Post: snippsat
  Closing logger from other function problem Paqqno 1 1,114 Apr-25-2022, 11:49 AM
Last Post: Gribouillis
  Closing logger to rename directory malcoverc 1 1,204 Apr-19-2022, 07:06 AM
Last Post: Gribouillis
  file icons have Firefox icon Ricvourn 4 1,431 Mar-31-2022, 11:40 PM
Last Post: Ricvourn
  logger option , where is the file? korenron 1 1,785 Apr-25-2021, 01:28 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020