I'm starting in programming, so I created a simple code, but it's giving this error:
I'm using Jupyter Notebook, this is the code, if anyone knows what the problem is, please help me
As the error already tells you, by.XPATH
doesn't exist. But by
has a class called By
and it's attribute XPATH
.
Like that:
from selenium.webdriver.common.by import By
driver = ...
elem = driver.find_element(By.XPATH, "YOUR_XPATH")