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

पायथन: मुझे ईमेल द्वारा सूचित करें जब एक निश्चित उत्पाद सबसे कम कीमत के आधार पर स्टोर में दिखाई देता है

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

आप यहां पूरा कोड देख सकते हैं:Https: // passin.com / nd8e yt xa

इंस्टॉलपायथन

मैं साइट को एक उदाहरण के रूप में ले जाऊंगाHttps: // 呜呜 .ok a i.ro/ से

इस वेबसाइट पर किसी उत्पाद का एक उदाहरण के रूप में, मैं पुस्तक की तलाश करूंगा:"Ecclasiala कला में ड्राइंग, रंग, संरचना और अभिव्यक्ति का अध्ययन"

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

उल्लेख:यदि आप इस कोड को पृष्ठभूमि में लगातार चलाने के लिए चाहते हैं, तो आपको फ़ाइल एक्सटेंशन को बदलना होगा.pyमें .py

स्क्रिप्ट चलाने से पहले आपको निम्न कार्य करने की आवश्यकता है:

  • From the CMD (command prompt) console, run the command:पाइज स्थापित करें
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.

यदि आप बस फाइल को पायथन के साथ चलाना चाहते हैंOkazii.pyw।, आप भी ऐसा कर सकते हैं, लेकिन आपको हमेशा कंसोल खोलना चाहिए। आप निष्पादन को रोक सकते हैंCTRL + Cकमांड प्रॉम्प्ट से (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".

इसके अलावा, एक हैसंस्करण 2इस कोड यासंस्करण 3यासंस्करण 4यासंस्करण 5यासंस्करण 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