I have this code:
try:
price = wait(driver, 10).until(EC.presence_of_element_located((By.ID, "Trsdu(0.3s) Fw(b) Fz(36px) Mb(-4px) D(ib)"))).text
print(price)
except Exception:
print("element not found")
finally:
driver.quit()
What I want it to do, is to copy the stock price on yahoo and print it in the terminal. I was thinking, that it might not work because the stock price is changing and so does the class or something, but after trying to copy an unmoving element, it still doesn't work. What am I doing wrong?
The code of element on the site looks like that:
<span class="Trsdu(0.3s) Fw(b) Fz(36px) Mb(-4px) D(ib)" data-reactid="31">41.24</span>