I've been having trouble creating a function in python using selenium to click a button on a webpage.
I'm following a tutorial that is out of date. In the tutorial the code is:
driver.find_element_by_xpath('//div[@data-value="39455542968391"]')
Now, I know that selenium has changed how this is done but I am struggling to figure out the correct way of going about it.
driver.find_element(by=By.XPATH, value=('//button[@class="nice-select open"]').click()
this line gives the error:
unexpected EOF while parsing
and
driver.find_element("xpath", '//*[@class="nice-select open"].click()
this line gives the error:
name "EOL while scanning string literal
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.