Build a Simple Price Tracker with Python
📰 Medium · JavaScript
Learn to build a simple price tracker with Python to monitor product prices and receive alerts when prices drop, using tools like BeautifulSoup and Requests.
Action Steps
- Install the required tools using pip: 'pip install beautifulsoup4' and 'pip install requests'.
- Get the website content using Requests and BeautifulSoup: 'response = requests.get(url)' and 'soup = BeautifulSoup(response.text, html.parser)'.
- Extract the price from the website content using BeautifulSoup: 'price = soup.find(span, class_=price)'.
- Set a target price and compare it with the current price: 'if float(price.text.replace($,)) < target_price:'.
- Send an email alert using smtplib when the price drops: 'server = smtplib.SMTP()'.
Who Needs to Know This
This project is ideal for a solo developer or a small team looking to automate price tracking, and can be useful for entrepreneurs, marketers, or anyone interested in monitoring product prices.
Key Insight
💡 You can automate price tracking using Python and receive alerts when prices drop, making it easier to make informed purchasing decisions.
Share This
Build a simple price tracker with Python using BeautifulSoup and Requests!
Key Takeaways
Learn to build a simple price tracker with Python to monitor product prices and receive alerts when prices drop, using tools like BeautifulSoup and Requests.
Full Article
Title: 🛒 Build a Simple Price Tracker with Python
URL Source: https://medium.com/@iamdan4live/build-a-simple-price-tracker-with-python-e33af05fe7b7?source=rss------javascript-5
Published Time: 2026-04-12T22:23:28Z
Markdown Content:
# 🛒 Build a Simple Price Tracker with Python | by Daniel Thompson | Apr, 2026 | Medium
[Sitemap](https://medium.com/sitemap/sitemap.xml)
[Open in app](https://play.google.com/store/apps/details?id=com.medium.reader&referrer=utm_source%3DmobileNavBar&source=post_page---top_nav_layout_nav-----------------------------------------)
Sign up
[Sign in](https://medium.com/m/signin?operation=login&redirect=https%3A%2F%2Fmedium.com%2F%40iamdan4live%2Fbuild-a-simple-price-tracker-with-python-e33af05fe7b7&source=post_page---top_nav_layout_nav-----------------------global_nav------------------)
[](https://medium.com/?source=post_page---top_nav_layout_nav-----------------------------------------)
Get app
[Write](https://medium.com/m/signin?operation=register&redirect=https%3A%2F%2Fmedium.com%2Fnew-story&source=---top_nav_layout_nav-----------------------new_post_topnav------------------)
[Search](https://medium.com/search?source=post_page---top_nav_layout_nav-----------------------------------------)
Sign up
[Sign in](https://medium.com/m/signin?operation=login&redirect=https%3A%2F%2Fmedium.com%2F%40iamdan4live%2Fbuild-a-simple-price-tracker-with-python-e33af05fe7b7&source=post_page---top_nav_layout_nav-----------------------global_nav------------------)

[](https://medium.com/@iamdan4live?source=post_page---byline--e33af05fe7b7---------------------------------------)
[Daniel Thompson](https://medium.com/@iamdan4live?source=post_page---byline--e33af05fe7b7---------------------------------------)
1 min read
·
Just now
[](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fvote%2Fp%2Fe33af05fe7b7&operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40iamdan4live%2Fbuild-a-simple-price-tracker-with-python-e33af05fe7b7&user=Daniel+Thompson&userId=ee2a0e37974c&source=---header_actions--e33af05fe7b7---------------------clap_footer------------------)
--
[](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fbookmark%2Fp%2Fe33af05fe7b7&operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40iamdan4live%2Fbuild-a-simple-price-tracker-with-python-e33af05fe7b7&source=---header_actions--e33af05fe7b7---------------------bookmark_footer------------------)
[Listen](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2Fplans%3Fdimension%3Dpost_audio_button%26postId%3De33af05fe7b7&operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40iamdan4live%2Fbuild-a-simple-price-tracker-with-python-e33af05fe7b7&source=---header_actions--e33af05fe7b7---------------------post_audio_button------------------)
Share
🛒 Build a Simple Price Tracker with Python
Today we are building a simple price tracker that checks product prices and alerts you when the price drops.
---
Step 1: Install Required Tools
We use:
BeautifulSoup
Requests
Install them:
pip install beautifulsoup4
pip install requests
---
Step 2: Get Website Content
This code gets the webpage:
import requests
from bs4 import BeautifulSoup
url = "https://example.com"
response = requests.get(url)
soup = BeautifulSoup(response.text, "html.parser")
print(soup.title.text)
This reads the website content.
---
Step 3: Get the Price
Now we extract the price:
price = soup.find("span", class_="price")
print(price.text)
Now your program can read product prices.
---
Step 4: Set Your Target Price
target_price = 50
if float(price.text.replace("$","")) < target_price:
print("Price dropped!")
Now your program checks if the price is low.
---
Step 5: Send Email Alert
We use smtplib:
import smtplib
server =
URL Source: https://medium.com/@iamdan4live/build-a-simple-price-tracker-with-python-e33af05fe7b7?source=rss------javascript-5
Published Time: 2026-04-12T22:23:28Z
Markdown Content:
# 🛒 Build a Simple Price Tracker with Python | by Daniel Thompson | Apr, 2026 | Medium
[Sitemap](https://medium.com/sitemap/sitemap.xml)
[Open in app](https://play.google.com/store/apps/details?id=com.medium.reader&referrer=utm_source%3DmobileNavBar&source=post_page---top_nav_layout_nav-----------------------------------------)
Sign up
[Sign in](https://medium.com/m/signin?operation=login&redirect=https%3A%2F%2Fmedium.com%2F%40iamdan4live%2Fbuild-a-simple-price-tracker-with-python-e33af05fe7b7&source=post_page---top_nav_layout_nav-----------------------global_nav------------------)
[](https://medium.com/?source=post_page---top_nav_layout_nav-----------------------------------------)
Get app
[Write](https://medium.com/m/signin?operation=register&redirect=https%3A%2F%2Fmedium.com%2Fnew-story&source=---top_nav_layout_nav-----------------------new_post_topnav------------------)
[Search](https://medium.com/search?source=post_page---top_nav_layout_nav-----------------------------------------)
Sign up
[Sign in](https://medium.com/m/signin?operation=login&redirect=https%3A%2F%2Fmedium.com%2F%40iamdan4live%2Fbuild-a-simple-price-tracker-with-python-e33af05fe7b7&source=post_page---top_nav_layout_nav-----------------------global_nav------------------)

[](https://medium.com/@iamdan4live?source=post_page---byline--e33af05fe7b7---------------------------------------)
[Daniel Thompson](https://medium.com/@iamdan4live?source=post_page---byline--e33af05fe7b7---------------------------------------)
1 min read
·
Just now
[](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fvote%2Fp%2Fe33af05fe7b7&operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40iamdan4live%2Fbuild-a-simple-price-tracker-with-python-e33af05fe7b7&user=Daniel+Thompson&userId=ee2a0e37974c&source=---header_actions--e33af05fe7b7---------------------clap_footer------------------)
--
[](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fbookmark%2Fp%2Fe33af05fe7b7&operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40iamdan4live%2Fbuild-a-simple-price-tracker-with-python-e33af05fe7b7&source=---header_actions--e33af05fe7b7---------------------bookmark_footer------------------)
[Listen](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2Fplans%3Fdimension%3Dpost_audio_button%26postId%3De33af05fe7b7&operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40iamdan4live%2Fbuild-a-simple-price-tracker-with-python-e33af05fe7b7&source=---header_actions--e33af05fe7b7---------------------post_audio_button------------------)
Share
🛒 Build a Simple Price Tracker with Python
Today we are building a simple price tracker that checks product prices and alerts you when the price drops.
---
Step 1: Install Required Tools
We use:
BeautifulSoup
Requests
Install them:
pip install beautifulsoup4
pip install requests
---
Step 2: Get Website Content
This code gets the webpage:
import requests
from bs4 import BeautifulSoup
url = "https://example.com"
response = requests.get(url)
soup = BeautifulSoup(response.text, "html.parser")
print(soup.title.text)
This reads the website content.
---
Step 3: Get the Price
Now we extract the price:
price = soup.find("span", class_="price")
print(price.text)
Now your program can read product prices.
---
Step 4: Set Your Target Price
target_price = 50
if float(price.text.replace("$","")) < target_price:
print("Price dropped!")
Now your program checks if the price is low.
---
Step 5: Send Email Alert
We use smtplib:
import smtplib
server =
DeepCamp AI