- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
from selenium import webdriver
import time
import telegram
def A():
код парсера
while True:
browser = webdriver.Chrome()
browser.maximize_window()
browser.get('ссылка')
try:
BOT_TOKEN = 'токен'
number2 = browser.find_element_by_xpath('//*[@id="games_content"]/div/div[1]/div/div/div[5]/div/div[1]/div[1]/div').text
SS = number2.split()
if SS[0] == '0' and SS[1] == '0':
browser.find_element_by_xpath('//*[@id="games_content"]/div/div[1]/div/div/div[5]/div/div[1]/div[1]/a').click()
time.sleep(5)
A()
except Exception:
pass
try:
BOT_TOKEN = 'токен'
number2 = browser.find_element_by_xpath('//*[@id="games_content"]/div/div[1]/div/div/div[4]/div/div[1]/div[1]/div').text
SS = number2.split()
if SS[0] == '0' and SS[1] == '0':
browser.find_element_by_xpath('//*[@id="games_content"]/div/div[1]/div/div/div[4]/div/div[1]/div[1]/a').click()
time.sleep(5)
A()
except Exception:
pass
try:
BOT_TOKEN = 'токен'
number2 = browser.find_element_by_xpath('//*[@id="games_content"]/div/div[1]/div/div/div[3]/div/div[1]/div[1]/div').text
SS = number2.split()
if SS[0] == '0' and SS[1] == '0':
browser.find_element_by_xpath('//*[@id="games_content"]/div/div[1]/div/div/div[3]/div/div[1]/div[1]/a').click()
time.sleep(5)
A()
except Exception:
pass
try:
BOT_TOKEN = 'токен'
number2 = browser.find_element_by_xpath('//*[@id="games_content"]/div/div[1]/div/div/div[6]/div/div[1]/div[1]/div').text
SS = number2.split()
if SS[0] == '0' and SS[1] == '0':
browser.find_element_by_xpath('//*[@id="games_content"]/div/div[1]/div/div/div[6]/div/div[1]/div[1]/a').click()
time.sleep(5)
A()
except Exception:
pass
browser.close()
time.sleep(15)