Python Forum

Full Version: [Idea Required] How can i track any change on a webpage?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

i wish to write a python scripts which will have the ability to track webpage pages and if any change that will happen it will save those changes on csv.

Below are the things i am willing to implement but requires ideas:
1. A python script that can track changes
2. What are the libraries required
3. How to compare changes and get only thing that have changed?
4. How to display changes also?

any idea on it from where i can start would be helpful? Wall
I would just pull the website html via requests module every X number of times (requests because its better than standard library stuff) and difflib module for comparing the two html to get the difference between them. difflib will return similar info like git about changes of a string. What was added/removed/etc. difflib even has an embedded html difference class difflib.HtmlDiff()