Код: Выделить всё
url = "https://br.betano.com/casino/games/aviator/3337/fun/"
api_id = 44444444
api_hash = '1231313131'
client = TelegramClient('teste12', api_id, api_hash)
#client.start()
chrome_driver_path = "./chromedriver.exe"
chrome_driver_options = Options()
#chrome_driver_options.add_argument("--headless")
webdriver = webdriver.Chrome(
executable_path = chrome_driver_path,
options = chrome_driver_options
)
colors = None
def pegarsinais():
blackk = 0
redd = 0
with webdriver as driver:
wait = WebDriverWait(driver, 20)
driver.get(url)
time.sleep(10)
wait.until(presence_of_element_located((By.ID, "app")))
while True:
try:
data = [my_elem.text for my_elem in driver.find_elements(By.XPATH, "/html/body/app-root/app-game/div/div[1]/div[2]/div/div[2]/div[1]")][:1]
except:
data = [my_elem.text for my_elem in driver.find_elements(By.XPATH, "/html/body/app-root/app-game/div/div[1]/div[2]/div/div[2]/div[1]")][:1]
print(data)
time.sleep(10)
Я уже изменил xpath.
Код: Выделить всё
driver.find_elementsКод: Выделить всё
driver.find_elementКод: Выделить всё
driver.find_elements(By.CSS_SELECTOR, 'payouts-wrapper')Подробнее здесь: https://stackoverflow.com/questions/723 ... n-selenium
Мобильная версия