嘗試在https://www.mobile.ir/users/account/login.aspx中的電子郵件區(qū)域中輸入文本,但出現(xiàn)錯誤我嘗試使用 webdriverwait 但它沒有工作感謝提前聽到我的代碼:import timeimport datetimeimport randomfrom selenium.webdriver.chrome.options import Optionsfrom selenium import webdriverfrom selenium.webdriver.common.by import Byfrom selenium.webdriver.support.ui import WebDriverWaitfrom selenium.webdriver.support import expected_conditions as ECch_options=Options()ch_options.add_argument("--user-data-dir=chrome-data")chrome=webdriver.Chrome(options=ch_options,executable_path="/Users/LENOVO/Desktop/chromedriver.exe")ch_options.add_argument("user-data-dir=chrome-data")chrome.get("https://www.mobile.ir/users/account/login.aspx")chrome.find_element_by_name("email").send_keys("myemail")我得到這個錯誤: File "C:\Users\LENOVO\PycharmProjects\mobile.ir\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "C:\Users\LENOVO\PycharmProjects\mobile.ir\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace)selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable (Session info: chrome=83.0.4103.116)
1 回答
長風秋雁
TA貢獻1757條經(jīng)驗 獲得超7個贊
您可能想嘗試查找具有完整 xpath 的元素。我有一個類似的問題,我必須單擊具有屬性 javascript onclick 函數(shù)的元素。完整的 xpath 方法有效并且沒有拋出可交互的異常。
查看該站點,我認為這可能是電子郵件的路徑:
//*[@id="login_email"]
完整的 xpath 是:
/html/body/div[1]/div[3]/div[1]/div[2]/form/div[3]/input
希望這可以幫助!!
添加回答
舉報
0/150
提交
取消
