i am trying to make a little program that gets the price of electricity each hour. it will retrieve the text displaying the price of the electricity.
Here is my code
from selenium import webdriver
from selenium.webdriver.common.by import By
option = webdriver.ChromeOptions()
option.add_argument('-incognito')
option.add_argument("--headless")
option.add_argument('--enable-javascript')
option.add_argument("disable-gpu")
browser = webdriver.Chrome(executable_path='chromedriver.exe', options=option)
browser.get('https://www.elektrikell.ee/')
hind = browser.find_element(by=By.XPATH, value='//*[@id="root"]/div/div/div[1]/div[2]/div[2]/b')
Once i run it, it loads up the Webdriver and then crashes with the following error
Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="root"]/div/div/div[1]/div[2]/div[2]/b"}
(Session info: headless chrome=103.0.5060.134)
it happens to everything except the HTML , when i copy that Xpath, it works fine. I enabled Javascript because i thought it might fix it, yet here i am.
Does python not support JavaScript based websites?