Giter Site home page Giter Site logo

chandan0069 / amazon-price-tracker Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3 KB

This Python script tracks the price of a specific product on Amazon. It sends an email notification if the price drops below a predefined threshold. The script utilizes web scraping techniques with requests and BeautifulSoup libraries to extract the product price from the Amazon webpage. It then uses SMTP to send notifications through Gmail.

Python 100.00%
beautifulsoup4 functions notification-system requests smtp web-scraping

amazon-price-tracker's Introduction

Amazon Price Tracker

This script tracks the price of a specific product on Amazon and sends an email notification if the price drops below a certain threshold.

Requirements

  • Python 3.x
  • requests library
  • BeautifulSoup library
  • lxml parser
  • smtplib library (for sending emails)
  • An email account (Gmail) from which the notifications will be sent

Installation

  1. Clone or download the repository to your local machine.
  2. Install the required libraries using pip:
  3. Set up your Gmail account to allow less secure apps to access it. You can do this by going to your Google Account settings, then navigate to "Less secure app access" and turn it on.
  4. Export your email and password as environment variables: Alternatively, you can directly replace MY_EMAIL and MY_PASSWORD variables in the script with your email and password (not recommended for security reasons).

Usage

Replace the url variable with the URL of the Amazon product you want to track.

Replace the BUY_PRICE variable with the desired price threshold. You will receive an email notification if the price drops below this value.

Alternatively, you can directly replace MY_EMAIL and MY_PASSWORD variables in the script with your email and password (not recommended for security reasons).

Script Explanation

  • The script sends an HTTP GET request to the Amazon product URL with specific headers to mimic a browser request.
  • It then parses the HTML content of the response using BeautifulSoup.
  • The script extracts the price of the product from the parsed HTML.
  • If the price drops below the specified threshold (BUY_PRICE), it sends an email notification using SMTP.

Note

  • This script is specifically designed to work with Gmail accounts. If you're using a different email service, you might need to modify the SMTP configuration accordingly.
  • Use this script responsibly and avoid spamming Amazon's servers with excessive requests.
  • Be cautious about storing your email credentials in plaintext within the script. Consider more secure methods such as environment variables or encrypted storage.

amazon-price-tracker's People

Contributors

chandan0069 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.