You get NoSuchElementException
, the driver can’t find your element. Change your xpath to this
driver.find_element_by_xpath("//*[@id='pnnext']/span[2]").click()
Without 3 quotation marks.
5
solved Selenium NoSuchElementException with driver.find_element_by_xpath