Skip to content

prashantkoirala465/Smart-Shopping-Assistant

Repository files navigation

Smart Shopping Assistant

Final project for my Python class. It searches for products across different websites and compares prices to find the best deals.

What it does

  • Searches multiple e-commerce sites/APIs for products
  • Compares prices and finds the cheapest option
  • Generates an HTML report you can view in browser

How to run

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

Project structure

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

Modes

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.

Dependencies

  • requests - for making http requests to APIs
  • selenium - for browser automation (real mode only)
  • webdriver-manager - automatically downloads chromedriver

About

Final project for my Python class. It searches for products across different websites and compares prices to find the best deals.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages