Automatically monitor any JB Hi-Fi product collection for new items (or restock; based on changes in product number). Get instant email notifications when new products are added!
Monitor any product category: Collectibles, physical media, and more!
- Python 3.7 or higher
- Chrome browser installed
- Gmail account (for notifications)
-
Clone the repository:
git clone https://github.com/yourusername/pokemon-tcg-monitor.git cd pokemon-tcg-monitor
-
Install dependencies:
pip install -r requirements.txt
-
Configure your settings:
# Copy the configuration template cp config_template.py config.py # Edit config.py with your email settings (see Configuration section below)
-
Run the monitor:
python JB-track.py
# In your config.py
PRODUCT_NAME = "MTG"
TARGET_URL = "https://www.jbhifi.com.au/collections/collectibles-merchandise/magic-the-gathering"
# In your config.py
PRODUCT_NAME = "Nintendo Switch 2 Games"
TARGET_URL = "https://www.jbhifi.com.au/collections/games-consoles/nintendo-switch-2-games"
# In your config.py
PRODUCT_NAME = "4K Ultra HD blu-rays"
TARGET_URL = "https://www.jbhifi.com.au/collections/movies-tv-shows/movies-4k-ultra-hd"
cp config_template.py config.py
Open config.py
and update these essential settings:
# === PRODUCT CONFIGURATION ===
PRODUCT_NAME = "Pokemon TCG" # What you're monitoring
TARGET_URL = "https://www.jbhifi.com.au/collections/collectibles-merchandise/pokemon-trading-cards"
# === EMAIL CONFIGURATION ===
EMAIL_USER = "youremail@gmail.com" # Your Gmail address
EMAIL_PASSWORD = "your_16_char_app_password" # Gmail App Password (see below)
NOTIFY_EMAIL = "youremail@gmail.com" # Where to send alerts
# === MONITORING CONFIGURATION ===
CHECK_INTERVAL = 360 # Check every 6 minutes (360 seconds)
config.py
!
- Go to Google Account Security
- Click 2-Step Verification and follow the setup process
- Complete all required steps including backup codes
- Go to Google Account Security
- Enable 2-Step Verification (if not already enabled)
- Complete all 2FA setup steps including backup codes
- Go to App Passwords
- Generate a new app password for "Pokemon Monitor"
- Copy the 16-character password and paste it into your
config.py
- Never use your regular Gmail password - it won't work and isn't secure
- Keep your App Password private - treat it like a regular password
- The
config.py
file is ignored by git - your credentials won't be uploaded to GitHub - You can revoke App Passwords anytime in your Google security settings
All settings are controlled through your config.py
file. Here are the available options:
CHECK_INTERVAL = 360 # Check every 6 minutes (in seconds), do NOT recommend lowering this
PRODUCT_NAME = "Your Product" # Name used in notifications
TARGET_URL = "https://..." # JB Hi-Fi collection URL to monitor
NOTIFY_ON_DECREASE = False # Get alerts when products are removed (sold out)
HEADLESS_MODE = True # Set to False to see browser window (for debugging)
ENABLE_LOGGING = False # Set to True for detailed Chrome output
TIMEOUT_SECONDS = 15 # How long to wait for page to load
SEND_TEST_EMAIL = True # Send confirmation email when script starts
DATA_FILE = "pokemon_count_data.json" # Where to store baseline data
MAX_RETRIES = 3 # Number of retries on errors
RETRY_DELAY = 300 # Wait 5 minutes between retries
# With configuration file
python JB-track.py
# First time (without config.py)
python JB-track.py
# Will show: "β οΈ config.py not found - using default settings"
# Copy config_template.py to config.py and configure your settings
β
Loaded settings from config.py
π Starting JB Hi-Fi Product Monitor
π― Product: Nintendo Switch Games
π Monitoring: https://www.jbhifi.com.au/collections/gaming/nintendo-switch
β° Check interval: 6 minutes
π§ Email notifications: Enabled
--------------------------------------------------
π§ Sending test email...
β
Notification sent!
π Checking Nintendo Switch Games products at 2025-07-30 19:45:00
π¦ Current: Showing 45 of 45 results
π First run - establishing baseline count
π΄ Sleeping for 6 minutes...
π ALERT: 3 new Nintendo Switch Games products detected!
π NOTIFICATION: π NEW Nintendo Switch Games Products at JB Hi-Fi!
π§ Email sent successfully!
jb-hifi-product-monitor/
βββ README.md # This file
βββ requirements.txt # Python dependencies
βββ JB-track.py # Main script (current version)
βββ config_template.py # Configuration template
βββ config.py # Your settings (ignored by git)
βββ jb_hifi_monitor_v1.py # Version 1: Basic requests
βββ jb_hifi_monitor_v2.py # Version 2: Enhanced parsing
βββ examples/
β βββ basic_usage.py # Simple usage example
β βββ advanced_config.py # Advanced configuration example
βββ docs/
βββ troubleshooting.md # Common issues and solutions
βββ changelog.md # Version history
"Could not find product count"
- The script might need time for products to load
- Check if JB Hi-Fi changed their website structure
- Try setting
HEADLESS_MODE = False
in config.py to see what's happening
"Error setting up WebDriver"
- Make sure Chrome is installed and up to date
- Install/update webdriver-manager:
pip install --upgrade webdriver-manager
- Check if your antivirus is blocking ChromeDriver
"Error sending notification"
- Verify your Gmail App Password is correct (16 characters, no spaces)
- Make sure 2-Factor Authentication is fully set up with backup codes
- Check if "Less secure app access" is disabled (this is correct)
"config.py not found"
- Copy the template:
cp config_template.py config.py
- Edit config.py with your actual email settings
- The script will work with defaults but email won't function
ChromeDriver version issues
- The script uses webdriver-manager to auto-download compatible drivers
- If it fails, you can manually download from ChromeDriver downloads
To see more detailed output and browser actions, edit your config.py
:
HEADLESS_MODE = False # See the browser window
ENABLE_LOGGING = True # Verbose Chrome output
- β Respectful monitoring - Configurable intervals won't overload servers (default: 6 minutes)
- β Public information - Only monitors publicly available product listings
- β No automated purchasing - Only monitors, doesn't buy anything
- β Universal tool - Works with any JB Hi-Fi product category
β οΈ Use responsibly - Do NOT decrease the interval below 5 minutes
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create a feature branch:
git checkout -b feature-name
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Selenium for browser automation
- Uses BeautifulSoup for HTML parsing
- webdriver-manager for automatic ChromeDriver management
This tool is for educational and personal use only. The authors are not responsible for any misuse or any consequences of using this script. Use at your own risk and be respectful of JB Hi-Fi's servers and terms of service.
Happy product hunting! ποΈβ¨