Online Purchase Bot

Jiajian Luo (He/Him)

PhD in Electronic Thermal Management, Semiconductor Packaging & Process Engineering

University of California, Irvine

Nov 4, 2024
Online Purchase Bot

One of my girlfriend’s favorite hobbies is buying Hermès bags. She used to browse the Hermès website almost daily but would often end up frustrated because the popular bags sold out so quickly.

To ease her grumbling (and keep the peace), I decided to create an online purchase bot just for her. This app checks the availability of specific bags on the Hermès website every minute. When a new arrival is detected, the bot springs into action—it rings an alarm, sends an email notification, and even completes the purchase automatically, just like a human.

Key features:
-Real-time monitoring: The bot checks the website every minute for new arrivals.
-Notifications: Sends an alarm and email as soon as it detects a restock.
-Automation: Completes the purchase process in under 30 seconds—no human intervention needed!

Here’s a look at the user interface

User interface

And here’s an example of the email notification it sends:

Email notification

This video shows the entire automation process, which can finish the entire purchase with less than 30 seconds from detection!

Creating this app was surprisingly straightforward. Here’s a quick breakdown of the main components:

1. Web Scraping
The first step is learning how to scrape website content. I used Python’s popular libraries, requests (https://pypi.org/project/requests/) and BeautifulSoup (https://pypi.org/project/beautifulsoup4/), to retrieve and parse the Hermès website data. Here’s an example of the basic scraping code:

2. Mimicking Human Actions
To automate the purchase process, I used the pyautogui (https://pyautogui.readthedocs.io/en/latest/) library. This library lets you mimic human actions like moving the mouse, clicking buttons, and typing text. For example, to locate and click a “pay” button:

3. Notifications and User Interface

Other than those, you may also need tkinter library (https://docs.python.org/3/library/tkinter.html) for user interface, and email library (https://docs.python.org/3/library/email.examples.html) for sending email.

This project was not just fun but also super practical (for my sanity). If you’re into web scraping, automation, or just want to save someone from the frustration of online shopping, give it a try!

Hope you enjoy this app!

More Details

One thought on “Online Purchase Bot

Comments are closed.