📈
Amazon Product Availability Checker
A console script that fetches an Amazon product page, parses it with BeautifulSoup, and reports whether the product is in stock.
A console script that fetches an Amazon product page, parses it with BeautifulSoup, and reports whether the product is in stock.
A console script that fetches an Amazon product page, parses it with BeautifulSoup, and reports whether the product is in stock.
Before running, edit amazon.py:
product_url to the Amazon product page you want to track.User-Agent string in headers (Amazon blocks the default one).After setting product_url and User-Agent in amazon.py and running the
script, the console prints one of:
Wireless Bluetooth Headphones is available on Amazon.
or
Wireless Bluetooth Headphones is currently out of stock on Amazon.
pip install requests beautifulsoup4
python amazon.py
requests — fetches the product pagebeautifulsoup4 — parses the HTML