Python Script for Remote Browser History Collection and Email Reporting
This tutorial demonstrates how to use Python on macOS to extract Chrome browsing history from a target computer, generate a text report, and automatically send it via a QQ email account, while outlining the required environment, code snippets, and practical challenges.
This article explains how to create a Python-based tool that remotely retrieves a target computer's Chrome browsing history, saves it as a text file, and automatically emails the report using a QQ mailbox.
The process works by copying the Chrome History SQLite file, running a Python script ( get_history.py ) to parse the records, and then executing another script ( send_mail.py ) to attach the result and send it via SMTP.
Legal disclaimer: the technique is intended for learning and legitimate testing only; illegal use is prohibited.
Development environment
Chrome, Python 3.6, macOS Sierra, QQ email address for sending, recipient email address, SMTP server smtp.qq.com , and QQ email authorization code.
Practical steps
1. Copy the Chrome History file: cp /Users/Marcel/Library/Application Support/Google/Chrome/Default/History /Users/Marcel/Desktop/tmp/code/chrome_history/
2. Extract history: python /Users/Marcel/Desktop/tmp/code/chrome_history/get_history.py
3. Send the report via email: python /Users/Marcel/Desktop/tmp/code/chrome_history/send_mail.py /Users/Marcel/Desktop/tmp/code/chrome_history/result.txt
The article includes several screenshots illustrating the environment setup, script outputs, and final email results.
Common challenges
The target computer must be online for the monitoring to work, and proper SMTP credentials are required; otherwise the script cannot send the email.
Disclaimer: Content is collected from the internet; all copyrights belong to the original author. Please contact us for removal or licensing requests.
Python Programming Learning Circle
A global community of Chinese Python developers offering technical articles, columns, original video tutorials, and problem sets. Topics include web full‑stack development, web scraping, data analysis, natural language processing, image processing, machine learning, automated testing, DevOps automation, and big data.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.