- I want to use the span tag to access the class, and not through xpatch, well, when I try to get an empty array or an error, in this site I parsed the prices and when they change, they come to the telegram bot only prices and names there is an infinite loop after the start button, it will endlessly check the list in which there is already data it will check and if the price changes it will send a response in telegram
https://i.sstatic.net/oXloI.png
# -*- coding: utf8 -*-
import telebot
import re
from selenium import webdriver
from time import sleep
PATH ="Desktop\parser\chromedriver"
driver = webdriver.Chrome(PATH)
bot = telebot.TeleBot("bot api")
@bot.message_handler(commands=['start'])
def start(message):
bot.send_message(message.chat.id, "Create a price list")
# eldorado
link_eldo = "https://www.eldorado.ru/c/smartfony/b/APPLE/?page=1"
driver.get(link_eldo)
def func (i):
i = i + 1
return i
name_eldo_product = driver.find_elements_by_xpath("/html/body/div[3]/div[1]/div[2]/div[8]/div[2]/div[1]/ul/li['func(0)']/div[2]/div[1]/div[2]/a")
price_eldo_product = driver.find_elements_by_xpath("/html/body/div[3]/div[1]/div[2]/div[8]/div[2]/div[1]/ul/li['func(0)']/div[2]/div[2]/div[2]/span")