Final project for my Python class. It searches for products across different websites and compares prices to find the best deals.
- Searches multiple e-commerce sites/APIs for products
- Compares prices and finds the cheapest option
- Generates an HTML report you can view in browser
First install dependencies:
pip install -r requirements.txt
Then run with either demo or real mode:
# demo mode - uses free APIs, always works
python main.py "laptop" --demo
# real mode - scrapes amazon/ebay (might get blocked sometimes)
python main.py "laptop" --real
# get more results
python main.py "phone" --demo --max 10
main.py - main script, handles args and runs everything
models.py - Product dataclass
analysis.py - price comparison logic
report.py - generates the html report
utils.py - helper functions
scrapers/
demo.py - scrapers for demo APIs (dummyjson, fakestore, platzi)
real.py - selenium scrapers for amazon/ebay
reports/ - generated reports get saved here
Demo mode (--demo): Uses free fake store APIs. Good for testing and presentations since it always works.
Real mode (--real): Actually scrapes Amazon and eBay using Selenium. These sites have anti-bot protection so it might not work every time.
- requests - for making http requests to APIs
- selenium - for browser automation (real mode only)
- webdriver-manager - automatically downloads chromedriver