Automatic scraping and tracking of prices of products of interest using R.
- The
productList.csv
details the products of interest. It must have three columns:- Store: Only supports
ChemistWarehouse
orSephora
at the moment. - Product: Alphanumeric name of the product.
- URL: Valid URL to the product on the website.
- Store: Only supports
In Terminal, run the following:
chmod +x main.R
./main.R
This can be done with a cron job, see here for details for setting one up on Mac: https://betterprogramming.pub/https-medium-com-ratik96-scheduling-jobs-with-crontab-on-macos-add5a8b26c30
- Run
crontab -e
in Terminal; this opens up a vim editing window. Pressi
to get into editing mode. - Add the following cron command:
0 0 * * * cd ~/Documents/Projects/PriceTracker && ./main.R
(change the path to wherever the directory was cloned). Escape
, type:x
, and pressEnter
to save changes.
- productPrices.csv: CSV file that includes columns for today's date, current price, RRP, whether the product is on sale, the discount, and discount as a proportion of RRP.
- priceTrackerPlot.pdf: Plot of the prices of each product over time.