久久久久久久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 檢測圖像中矩形的中心和角度)
    主站蜘蛛池模板: 国产在线精品一区二区 | 美日韩免费视频 | aaa综合国产 | 精品伦精品一区二区三区视频 | aa级毛片毛片免费观看久 | 欧美精品在欧美一区二区 | 国产亚洲精品综合一区 | 我爱操| 9久久精品 | 伊人婷婷 | 农夫在线精品视频免费观看 | 成人做爰www免费看 午夜精品久久久久久久久久久久 | 亚洲欧洲视频 | 久久久久亚洲 | 黑人巨大精品欧美一区二区免费 | 91就要激情 | 99精彩视频 | 精品久久久久久久人人人人传媒 | 中文字幕高清一区 | 免费观看黄a一级视频 | 国产精品91久久久久久 | 亚洲精品91 | 国产在线观 | 9999国产精品欧美久久久久久 | 伊色综合久久之综合久久 | 福利视频网站 | 亚洲综合色网站 | 国产综合av | 97精品超碰一区二区三区 | 日韩欧美第一页 | 日韩欧美国产一区二区三区 | 本道综合精品 | 成人午夜电影网 | 黄色国产在线视频 | 九九综合九九 | 美女中文字幕视频 | 国产偷自视频区视频 | 成人精品视频99在线观看免费 | 夜夜夜久久| 蜜桃视频在线观看免费视频网站www | 福利视频网|