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: Ampahafantaro ahy amin'ny mailaka rehefa misy vokatra iray hita ao amin'ny fivarotana miankina amin'ny vidiny ambany indrindra

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

Azonao atao ny mijery ny kaody feno:HTTPS: // passin.com / nd8e yt xa

hametrakaPython.

Entiko ho ohatra ny tranokalaHTTPS: // 呜呜 .ok a avy amin'ny i.ro/

Ho ohatra amin'ny vokatra iray amin'ity tranokala ity ihany, dia hitady ilay boky aho:"Halalino ny sary, loko, famoronana ary fitenenana ao amin'ny Art Art"

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

Mitanisa:Raha tianao ny mihazakazaka tsy tapaka ao ambadika ity code ity, dia mila manova ny fanitarana ny rakitra ianao.PYao amin'ny .p

Alohan'ny hampandehanana ny script dia mila ataonao izao:

  • From the CMD (command prompt) console, run the command:Pip Mametraka 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.

Raha te-hitantana fotsiny ny rakitra miaraka amin'ny python ianaookazii.pyw., afaka manao an'izany ihany koa ianao, fa tokony hitazona hatrany ny console. Azonao atao ny manakana ny famonoana olonaCtrl + CAvy amin'ny baikon'ny baiko (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".

Ary koa, misyVersion 2amin'ity code ity naVersion 3naVersion 4naVersion 5naVersion 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