久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

selenium.common.exceptions.NoSuchElementException:消息:沒有

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element while trying to click Next button with selenium(selenium.common.exceptions.NoSuchElementException:消息:沒有這樣的元素:嘗試使用
本文介紹了selenium.common.exceptions.NoSuchElementException:消息:沒有這樣的元素:嘗試使用 selenium 單擊下一步按鈕時無法找到元素的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

所以我嘗試使用 selenium 單擊下一步按鈕,我嘗試使用下面的代碼,但它以錯誤結束.

So Im trying to I click the next button using selenium, I've tried with the code below, but it ends in error.

元素

<input type="submit" name="submitNext" value="Next">

我的代碼

driver.find_element_by_name("submitNext").click()

然后它會輸出這些錯誤

Traceback (most recent call last):
  File "C:/Users/thomas/PycharmProjects/test/mainapp/main.py", line 194, in 
<module>
    visa()
  File "C:/Users/thomas/PycharmProjects/test/mainapp/main.py", line 174, in visa
driver.find_element_by_name("submitNext").click()
  File "C:Users	homasPycharmProjectsBudgetMainvenvlibsite-packagesseleniumwebdriver
emotewebdriver.py", line 487, in find_element_by_name
return self.find_element(by=By.NAME, value=name)
  File "C:Users	homasPycharmProjectsBudgetMainvenvlibsite-packagesseleniumwebdriver
emotewebdriver.py", line 955, in find_element
'value': value})['value']
  File "C:Users	homasPycharmProjectsBudgetMainvenvlibsite-packagesseleniumwebdriver
emotewebdriver.py", line 312, in execute
self.error_handler.check_response(response)
  File "C:Users	homasPycharmProjectsBudgetMainvenvlibsite-packagesseleniumwebdriver
emoteerrorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"name","selector":"submitNext"}
  (Session info: chrome=66.0.3359.170)
  (Driver info: chromedriver=2.36.540470 (e522d04694c7ebea4ba8821272dbef4f9b818c91),platform=Windows NT 10.0.16299 x86_64)

任何人對如何正確單擊該按鈕有任何想法?

Anyone have any ideas as to how to click that button without errors?

推薦答案

這個錯誤信息...

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"name","selector":"submitNext"}
  (Session info: chrome=66.0.3359.170)
  (Driver info: chromedriver=2.36.540470)

...暗示 ChromeDriver 無法找到所需的元素.

...implies that the ChromeDriver was unable to locate the desired element.

根據您共享的 HTML 來單擊元素,您可以使用以下任一定位器策略:

As per the HTML you have shared to click on the element you can use either of the following Locator Strategies :

  • css_selector:

driver.find_element_by_css_selector("input[name='submitNext'][value='Next']").click()

  • xpath:

    driver.find_element_by_xpath("http://input[@name='submitNext' and @value='Next']").click()
    

  • 但是您的主要問題是您使用的二進制文件之間的版本兼容性,如下所示:

    However your main issue is the version compatibility between the binaries you are using as follows :

    • 您正在使用 chromedriver=2.36
    • chromedriver=2.36 的發行說明明確提及以下內容:

    支持 Chrome v63-65

    • 您正在使用 chrome=66.0
    • ChromeDriver v2.38 明確提及以下內容:
    • 支持 Chrome v65-67

      • 我們不知道您的 Selenium 客戶端 版本.
      • 所以 ChromeDriver v2.36Chrome 瀏覽器 v66.0 之間存在明顯的不匹配

        So there is a clear mismatch between the ChromeDriver v2.36 and the Chrome Browser v66.0

        • Selenium 升級到當前級別版本 3.11.0.
        • ChromeDriver 升級到當前的 ChromeDriverv2.38 級別.
        • Chrome 版本保持在 Chrome v66.x 級別.(根據 ChromeDriver v2.38 發行說明)
        • 清理你的項目工作區通過你的IDE重建你的項目只需要依賴.
        • 使用 CCleaner 工具清除之前和在您的測試套件執行之后.
        • 如果您的基礎 Web Client 版本太舊,請通過 卸載它Revo Uninstaller 并安裝最新的 GA 和發布版本的 Web Client.
        • 進行一次系統重啟.
        • 執行你的 @Test.
        • Upgrade Selenium to current levels Version 3.11.0.
        • Upgrade ChromeDriver to current ChromeDriver v2.38 level.
        • Keep Chrome version at Chrome v66.x levels. (as per ChromeDriver v2.38 release notes)
        • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
        • Use CCleaner tool to wipe off all the OS chores before and after the execution of your test Suite.
        • If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
        • Take a System Reboot.
        • Execute your @Test.

        這篇關于selenium.common.exceptions.NoSuchElementException:消息:沒有這樣的元素:嘗試使用 selenium 單擊下一步按鈕時無法找到元素的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

        【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

    相關文檔推薦

    How to draw a rectangle around a region of interest in python(如何在python中的感興趣區域周圍繪制一個矩形)
    How can I detect and track people using OpenCV?(如何使用 OpenCV 檢測和跟蹤人員?)
    How to apply threshold within multiple rectangular bounding boxes in an image?(如何在圖像的多個矩形邊界框中應用閾值?)
    How can I download a specific part of Coco Dataset?(如何下載 Coco Dataset 的特定部分?)
    Detect image orientation angle based on text direction(根據文本方向檢測圖像方向角度)
    Detect centre and angle of rectangles in an image using Opencv(使用 Opencv 檢測圖像中矩形的中心和角度)
    主站蜘蛛池模板: 久久久久国产 | 视频在线观看一区二区 | 一区二区三区免费 | 成年男女免费视频网站 | 熟女毛片| 日韩中文字幕一区二区 | 一区二区三区四区国产 | 日韩在线小视频 | 日韩精品一区二区三区在线播放 | 日本 欧美 三级 高清 视频 | 国产美女特级嫩嫩嫩bbb片 | 碰碰视频| 国产一区二区三区免费观看在线 | 天堂在线www| 岛国毛片| 中文字幕成人免费视频 | 成人av大全| 欧美国产视频 | 91原创视频在线观看 | 国产精品欧美一区二区三区 | 国产伦精品一区二区三区在线 | 精品久久久久久 | 日日摸日日爽 | 99精品视频在线观看免费播放 | 成人夜晚看av | 99精品视频一区二区三区 | 国产精品婷婷 | 成人一区二区三区 | 99精品视频在线观看 | 黄频视频| 国产精品一区二区三区四区 | 久久99精品国产麻豆婷婷 | 在线视频久久 | 久久久激情视频 | 午夜视频一区 | 国产xxxx搡xxxxx搡麻豆 | 久久这里只有精品首页 | 爱爱小视频| 国产乱码精品一区二区三区忘忧草 | 亚洲激情av | 亚洲国产一区二区三区在线观看 |