feat(baby): Add price to message

parent 92a4cc34
...@@ -10,10 +10,11 @@ def main(): ...@@ -10,10 +10,11 @@ def main():
res = requests.get(url) res = requests.get(url)
soup = BeautifulSoup(res.content, "html.parser") soup = BeautifulSoup(res.content, "html.parser")
name = soup.find(attrs={"class": "product_title"}).text name = soup.find(attrs={"class": "product_title"}).text
price = soup.find(attrs={"class": "woocommerce-Price-amount amount"}).text
stock = soup.find(attrs={"class": "stock"}).text stock = soup.find(attrs={"class": "stock"}).text
if "Out of stock" not in stock: if "Out of stock" not in stock:
sms("%s en stock: \"%s\"\n-> %s" % (name, stock, url)) sms("%s en stock pour %s: \"%s\"\n-> %s" % (name, price, stock, url))
else: else:
print("%s pas en stock..." % name) print("%s pas en stock..." % name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment