The command that I use to click on an element in my script is:
mydriver.find_element(By.xpath("/html/body/div[1]/a/img")).click()
The execution of the script returns this error:
Traceback (most recent call last):
File "click.py", line 12, in <module>
mydriver.find_element(By.xpath("/html/body/div[1]/a/img")).click()
AttributeError: type object 'By' has no attribute 'xpath'
How could the problem be fixed ?