I'm trying to take the balance value from its tags HTML code of the balance: I tried different ways.All paths are like through CLASS_NAME, XPATH,CSS_SELECTORS, but none of them helps.I don't know what I'm doing wrong? Maybe I'm not finding the way to the right tag correctly? Who is not difficult, can explain the HTML code below how to get a balance? Who will help to deduce the value of the balance I will be very grateful
My function:
def bet():
driver.get(url = "https://stake.jp/casino/games/evolution-stake-exclusive-speed-baccarat-1")
time.sleep(2)
driver.find_element(By.XPATH, "/html/body/div[1]/div[2]/div[2]/div[4]/div/div/div/div[1]/div/div/div[2]/div/div/div[1]/div/div/div/div/div/div[1]/div/div[2]/button").click()
time.sleep(2)
# driver.find_element(By.CLASS_NAME/XPATH/CSS_SELECTOR, "css selector") #one of them
# #OR
# WebDriverWait(driver,10).until(EC.presence_of_element_located((By.CLASS_NAME, "class name here")))
Error with driver.find_element() method:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":".balance"}
Error with EC.presence_of_element_located() method:
WebDriverWait(driver,10).until(EC.presence_of_element_located((By.XPATH,
"/html/body/div[4]/div/div[2]/div/div/div[7]/div[3]/div/div/div[1]")))
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\support\wait.py", line 90, in until
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: