Automation Lab
•
2024-03-06
Build a Price Tracker with Discord Notifications
Estimated Time
12 MIN
Environment
Python 3.x, Requests, BeautifulSoup
Overview
Never miss a deal
Ever missed a 50% discount because you weren't looking? This Python script checks Amazon (or any store) every hour and pings your Discord server when the price drops.
Architecture
- Scraper: Pulls the current price from the HTML.
- Logic: Compares it with your "Target Price".
- Webhook: Sends a POST request to Discord.
01
Step 1 The Code
import requests
from bs4 import BeautifulSoup
URL = "https://www.example-store.com/item-123"
HEADERS = {"User-Agent": "Mozilla/5.0"}
TARGET_PRICE = 5000
def check_price():
page = requests.get(URL, headers=HEADERS)
soup = BeautifulSoup(page.content, 'html.parser')
price = float(soup.find(id="price").get_text().replace('$', ''))
if price < TARGET_PRICE:
send_discord_alert(price)
def send_discord_alert(price):
webhook_url = "YOUR_DISCORD_WEBHOOK_URL"
data = {"content": f"🚨 PRICE DROP! Now \${price}. Buy here: {URL}"}
requests.post(webhook_url, json=data)
check_price()
Automation
Deployment
Use GitHub Actions to run this script every 60 minutes for free!
Download Full Automation Pack
Get all source codes, advanced configurations, and exclusive troubleshooting guides.
FREE DOWNLOADSecure Verification Required