Skip to content

mariokhoury4/amazonBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“‰ Amazon Price Tracker Bot

A Python bot that automatically checks Amazon product prices and sends an email alert when the price drops below your defined target. Tracks multiple products and runs headlessly using Selenium + BeautifulSoup.


πŸ›  Features

  • βœ… Tracks multiple Amazon products via a products.json file
  • βœ… Sends email alerts (Outlook or Gmail) when price drops
  • βœ… Headless Chrome browser for fast scraping
  • βœ… Clean code structure (modular Python files)
  • βœ… Debug logs and fallback HTML dump when blocked

πŸ§ͺ Example Usage

python main.py

πŸ—‚ Project Structure

amazon-price-tracker/
β”œβ”€β”€ main.py                 # Entry point
β”œβ”€β”€ config.py               # Email receiver, constants
β”œβ”€β”€ products.json           # List of products to track
β”œβ”€β”€ browser.py              # Headless Chrome setup
β”œβ”€β”€ email_utils.py          # Outlook or Gmail email sender
β”œβ”€β”€ price_checker.py        # Scraper & logic
β”œβ”€β”€ utils.py                # Helpers (title/price extractors)
β”œβ”€β”€ requirements.txt        # Pip dependencies
β”œβ”€β”€ .env                    # (Optional) Secrets (email user/pass)
└── README.md               # You're reading it!

πŸ”§ Configuration

products.json

[
  {
    "url": "https://www.amazon.com/dp/B0CL12QNNK",
    "target_price": 70.00
  },
  {
    "url": "https://www.amazon.com/dp/B08FC5L3RG",
    "target_price": 89.00
  }
]

.env (Optional)

Create a .env file in the project root with:

[email protected]
EMAIL_PASS=your_app_password

If using Gmail: generate an App Password If using Outlook: OAuth2 setup is required (see documentation)

πŸ“¦ Installation

git clone https://github.com/your-username/amazon-price-tracker.git
cd amazon-price-tracker
pip install -r requirements.txt

πŸ’Œ Email Setup

Gmail (easiest)

  • Enable 2FA
  • Create an App Password
  • Paste it into your .env

Outlook

  • Outlook no longer supports basic auth
  • You must register an Azure app, use OAuth2, and request an SMTP access token

🧱 Dependencies

selenium
webdriver-manager
beautifulsoup4
requests
requests-oauthlib  # Only needed for Outlook OAuth2
python-dotenv      # Optional, for reading .env

Install with:

pip install -r requirements.txt

About

Check the amazon Price of an item and email you if the price is bellow a certain level

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages