This Python package allows you to track Amazon product prices and generate detailed reports. It uses Selenium for web scraping and provides a simple yet powerful way to keep an eye on your favorite products.
- Python 3.x
- Selenium
- ChromeDriver
- Clone the repository:
git clone https://github.com/jgavrilo/Amazon-Price-Tracker.git
- Navigate to the project directory:
cd Amazon-Price-Tracker
- Install Selenium:
pip install selenium
Edit the amazon_config.py
file to set your preferences:
NAME
: Product name to track.CURRENCY
: Currency symbol (e.g., "$").MIN_PRICE
andMAX_PRICE
: Price range to filter the search results.
You can run the script with command-line parameters to specify the product name, currency, and price range. Here's how to do it:
python3 simple_tracker.py --name "Kindle" --currency "$" --min_price "50" --max_price "200"
This will track Kindle products with prices ranging from $50 to $200.
If you want to run the script with the default values specified in amazon_config.py
, you can simply execute:
python3 simple_tracker.py
This will use the default values for NAME
, CURRENCY
, MIN_PRICE
, and MAX_PRICE
as specified in the code or amazon_config.py
.
The amazon_api.py
script provides a class for scraping product data from Amazon. To use it, simply import the AmazonAPI
class from the script and create an instance with the following parameters:
search_term
: The search term for the products you want to scrapefilters
: A dictionary of filters for the price range of the products you want to scrapebase_url
: The base URL for Amazon in your regioncurrency
: The currency used on Amazon in your region
Then call the run
method of the instance to scrape the product data. The method returns a list of dictionaries, where each dictionary contains the product data for a single product.
The generate_report.py
script provides a class for generating reports based on the product data scraped with the AmazonAPI
class. To use it, simply import the GenerateReport
class from the script and create an instance with the following parameters:
file_name
: The name of the report filefilters
: A dictionary of filters for the price range of the products scraped with theAmazonAPI
classbase_link
: The base URL for Amazon in your regioncurrency
: The currency used on Amazon in your regiondata
: The list of dictionaries containing the product data scraped with theAmazonAPI
class
Then call the constructor of the instance to generate the report. The report will be saved as a JSON file to the directory specified in the amazon_config.py
script.
This package was created by Jeremy Gavrilov.