ro  fr  en  es  pt  ar  zh  hi  de  ru
ART 2.0 ART 3.0 ART 4.0 ART 5.0 ART 6.0 Pinterest

Python: Benachrichtigen Sie mich per E-Mail, wenn ein bestimmtes Produkt je nach dem niedrigsten Preis im Speicher erscheint

On March 16, 2022, in Leadership Quantum-XX, by Neculai Fantanaru

Sie können hier den vollständigen Code ansehen:Https: // passin.com / nd8e yt xa

InstallierenPython.

Ich werde den Standort als Beispiel nehmenHttps: // 呜呜 .ok a von i.ro/

Auch als Beispiel für ein Produkt auf dieser Website suche ich nach dem Buch:"Studie der Zeichnung, Farbe, Zusammensetzung und Ausdruck in der kirchlichen Kunst"

The Python code will have to notify me by email when this book returns to stock, with a price of less than 90 RON.

Erwähnen:Wenn Sie möchten, dass dieser Code ständig im Hintergrund ausgeführt wird, müssen Sie die Dateierweiterung von ändernPausein Pause

Bevor Sie das Skript ausführen, müssen Sie Folgendes tun:

  • From the CMD (command prompt) console, run the command:Pip installieren Pythonw
To start the program run the following command in CMD (in the folder where the file is located):
  • pythonw okazii.pyw
Now the process will run continuously in the background. To stop the process, you must run the command:
  • TASKKILL /F /IM pythonw.exe
CAREFUL!!! All commands are run from the command line in the folder where the file is located.

Wenn Sie einfach die Datei mit Python ausführen möchtenokazii.pyw.Sie können das auch tun, aber Sie sollten die Konsole immer offen halten. Sie können die Ausführung mit stoppenStrg + C.von der Eingabeaufforderung (CMD)

Do not use GMAIL for default email adress !

#-------------------------------------------------------------------------------
# Author:      Fantanaru Neculai
#
# Created:     16/03/2022
# Copyright:   (c) Fantanaru Neculai 2022
#-------------------------------------------------------------------------------

from bs4 import BeautifulSoup as bs
import pandas as pd
pd.set_option('display.max_colwidth', 500)
import time
import requests
import random
import re

page = requests.get("https://www.okazii.ro/")

soup = bs(page.content)

# Studiul desenului, culorii, compozitiei si expresiei in arta eclesiala
result = requests.get("https://www.okazii.ro/cautare/studiul+desenului%2C+culorii%2C+compozitiei+si+expresiei+in+arta+eclesiala.html")

# preluam text dintre  si 
produse_sectiune_pattern = re.compile('([\s\S]*?)
') produse_sectiune = re.findall(produse_sectiune_pattern, result.text) produse_sectiune = produse_sectiune[0] preturi_pattern = re.compile('(.*?)') preturi = re.findall(preturi_pattern, produse_sectiune) print(preturi) count = 0 for pret in preturi: if int(pret) < 90: # puneti <= daca vreti ca pretul sa fie si egal cu 90 RON count += 1 print("Am gasit {} oferte cu pretul sub 90 lei.".format(count)) # soup_cautare = bs(result.text, 'html.parser') # print(soup_cautare) #items = soup_cautare.find_all(class_ = 'listing-product ') #print(items) # Trimitere email import sys import smtplib from_addr = 'YOUR EMAIL ADRESS' to_addrs = ['YOUR EMAIL ADRESS'] msg = """From: Sender To: Recipient Subject: Okazii Am gasit 1 oferte cu pretul sub 90 lei. """ try: s = smtplib.SMTP('mail.neculaifantanaru.com', 26) # put here your own SMTP PORT and hosting email s.login('YOUR EMAIL ADRESS', 'PASSWORD') # do not use GMAIL !! s.sendmail(from_addr, to_addrs, msg) s.quit() except smtplib.SMTPException: print("Error: ", sys.exc_info()[0])

That's all folks.

If you like my code, then make me a favor: translate your website into Romanian, "ro".

Außerdem gibt es eineVERSION 2von diesem Code oderVersion 3.oderVersion 4.oderVersion 5.oderVersion 6.


Latest articles accessed by readers:

  1. An Eye To See And A Mind To Understand
  2. Turn Towards Me With An Eye Full Of Your Own Gaze
  3. The Snapshot Of Magic In God's Universe
  4. Rhythm Of My Heart

Donate via Paypal

Alternate Text

RECURRENT DONATION

Donate monthly to support
the NeculaiFantanaru.com project

SINGLE DONATION

Donate the desired amount to support
the NeculaiFantanaru.com project

Donate by Bank Transfer

Account Ron: RO34INGB0000999900448439

Open account at ING Bank

Join The Neculai Fantanaru Community



* Note: If you want to read all my articles in real time, please check the romanian version !

decoration
About | Site Map | Partners | Feedback | Terms & Conditions | Privacy | RSS Feeds
© Neculai Fântânaru - All rights reserved