![](/img/trans.png)
[英]Selenium webdriver code for reading/Writing data from CSV in Python
[英]Writing a line of code with Selenium Webdriver in Python
我一直无法使用 selenium 在 python 中创建 function 以单击网页上的按钮。
我正在关注一个过时的教程。 在教程中,代码是:
driver.find_element_by_xpath('//div[@data-value="39455542968391"]')
现在,我知道 selenium 已经改变了这样做的方式,但我正在努力找出正确的方法。
driver.find_element(by=By.XPATH, value=('//button[@class="nice-select open"]').click()
这一行给出了错误:
unexpected EOF while parsing
和
driver.find_element("xpath", '//*[@class="nice-select open"].click()
这一行给出了错误:
name "EOL while scanning string literal
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.