from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
# go to website
chrome_options = Options()
chrome_options.add_experimental_option("detach", True)
driver = webdriver.Chrome(executable_path="chromedriver.exe", chrome_options=chrome_options)
action = webdriver.ActionChains(driver)
driver.get('https://www.clinicalkey.com/#!/browse/book/3-s2.0-C2016100010X')
# look for "login" and click
loginclick = driver.find_element_by_xpath("//*[@id='header']/div[3]/ol/li[3]/a/span").click()
How come I'm not able to click on the login section on top right after navigating to the website given? I get an error:
Exception has occurred: NoSuchElementException
Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id='header']/div[3]/ol/li[3]/a/span"}
(Session info: chrome=85.0.4183.83)
File "C:\python\download.py", line 18, in <module>
loginclick = driver.find_element_by_xpath("//*[@id='header']/div[3]/ol/li[3]/a/span").click()
Thank you !
