Other programs exist to track the price of items that you're interested in, but they're often restricted to support specific websites. This program is a universal price tracker, allowing you to track the price of any item you find online on any website. If it detects a drop in price, it will alert you.
By default, it will alert you by posting an entry to a Notion page. You can modify the code to be alerted however you prefer.
-
Download the repository.
-
Run
pip install -r requirements.txt
. -
In the
Config
section of the code, setSCRIPT_DIRECTORY_ABS_PATH
to be the absolute path to the repository, e.g.D:\Users\User\Path\To\universal-price-tracker
. -
Modify the rest of the configuration as desired.
-
When you find an item online whose price you want to track, make an entry for it in the Excel file.
-
Under
Item
, put the name of the item. -
Under
URL
, put the URL of the page that contains the price. -
Under
CSS Selector
, put a comma-delimited list of CSS selectors for the price HTML element. The script will return the first price found using these CSS selectors.- A CSS selector is a pattern that is used to find HTML elements in CSS. To get the CSS selector, right-click the price and click
Inspect
to examine the classes and IDs of the HTML elements associated with the price. Use combinators to come up with a CSS selector for the price.
- A CSS selector is a pattern that is used to find HTML elements in CSS. To get the CSS selector, right-click the price and click
-
You can leave
Last Tracked Price
empty.
-
-
You can run the program once to update the price of each item in the Excel file. Just run
python track_price.py
. -
If you want the program to run periodically, you can set up a scheduler. On Windows, I followed these instructions to create a .bat file that runs the program within my desired virtual environment, and then I followed these instructions to create a scheduler that runs this .bat file once per day.
- You can modify the
alert()
function to determine how you want to be notified about price drops. By default, it tries to notify you by posting to a Notion database. To set up the Notion integration, follow steps 1 and 2 in this guide, then add the Notion internal integration secret and database ID to theConfig
section of the code.