Hey everyone! I'm working on a small automation project to check the stock availability of a product on a supplier's website daily. The plan is to log in with my email and password, go to the product page (where the stock info is visible only after logging in), and grab the current stock value. If the stock level has changed from the previous day, I want to receive a WhatsApp message through CallMeBot. I'm not a professional developer, just someone who's curious and looking to simplify things. Any advice, examples, or links to similar projects would be awesome! Thanks!
3 Answers
Check if the supplier offers a REST API; that would make things easier. If not, you'll need to use web scraping methods. There are several Python libraries for that, just install one with pip and get started! Keep in mind, web scraping can get you blocked by the supplier, so proceed with caution. It's not an entirely easy task!
Good idea! Let me know how it goes!
This is a straightforward script, probably around 50 lines. You can use Selenium to log into the site, navigate to the product page, and grab the stock info with a CSS selector. For tracking the stock over time, use a small database or a CSV file to save and compare yesterday's stock level. Then, you can send messages with CallMeBot. Use a task scheduler to run it daily, but be careful to not get flagged for botting!
Thanks for the tip! I used ChatGPT to put it together and it's working. Now I'm trying to figure out how to run it online instead of just on my computer. Let me know if you have any ideas!
They will definitely block you eventually. Just a heads up, using Selenium or similar might raise flags since it’s detectable. It's all about timing!