![](/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.