This script monitors the availability of a product on Amazon and sends an email notification when the product becomes available.
- Python 3.x
- Chrome browser
- ChromeDriver
- Clone this repository
- Install the required packages:
pip install -r requirements.txt
- Create a
.env
file based on.env.example
:
cp .env.example .env
- Edit the
.env
file with your configuration:
- Set your Amazon product URL
- Set the chrome driver path
- Configure your email settings
- Adjust search text and check interval as needed
To use Gmail SMTP:
- Enable 2-factor authentication in your Google Account
- Generate an App Password for this application
- Use the App Password in the
SENDER_PASSWORD
environment variable
Run the script:
python3 check-product-availability.py
The script will:
- Check the product availability every X seconds
- Send an email notification when the product becomes available
- Exit after sending the notification
AMAZON_URL
: The Amazon product URL to monitorSMTP_SERVER
: SMTP server address (default: smtp.gmail.com)SMTP_PORT
: SMTP server port (default: 587)SENDER_EMAIL
: Your Gmail addressSENDER_PASSWORD
: Your Gmail App PasswordRECIPIENT_EMAIL
: Email address to receive notificationsPRODUCT_NAME
: Product name (default: Product)CHROME_DRIVER_PATH
: Path of the chrome driver executable (default: /usr/bin/chromedriver)SEARCH_TEXT
: Text to search for to determine availability (default : Currently unavailable.)CHECK_INTERVAL_SECONDS
: Base interval between checks (default: 30)