From 2bf05128b10d4b3309aa9c53a2cf21ac6e0099df Mon Sep 17 00:00:00 2001 From: Paul-Louis NECH Date: Sat, 30 Nov 2019 13:34:05 +0100 Subject: [PATCH] chore: Log failure --- baby.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/baby.py b/baby.py index b4747b8..5ccb443 100644 --- a/baby.py +++ b/baby.py @@ -9,10 +9,11 @@ def main(): soup = BeautifulSoup(res.content, "html.parser") name = soup.find(attrs={"class": "product_title"}).text stock = soup.find(attrs={"class": "stock"}).text - print("%s: %s" % (name, stock)) if "Out of stock" not in stock: sms("%s in stock šŸŽ‰ \"%s\"\nšŸ”— %s" % (name, stock, url)) + else: + print("%s not in stock, try again šŸ™ƒ" % name) def sms(msg: str): -- libgit2 0.27.0