Ошибка Python selenium: нет такого элемента: невозможно найти элемент

Я получаю эту ошибку при заполнении формы.

Ошибка:

нет такого элемента: Невозможно найти элемент:

{метод: идентификатор, селектор: идентификатор формы: codEmpresa}.

Любая помощь будет оценена по достоинству.

Вот мой код:

from selenium import webdriver
chrome = webdriver.Chrome()
chrome.get("https://www3.honda.com.br/newihs")

chrome.find_element_by_id("formId:codEmpresa").send_keys("Text1")
chrome.find_element_by_id("formId:codUsuario").send_keys("Text2")
chrome.find_element_by_id("formId:senha").send_keys("Text2")
chrome.find_element_by_id("formId:j_id68").click



Ответы (1)


Проблема в том, что форма входа, содержащая ваши идентификаторы, находится в iframe. Попробуйте https://www3.honda.com.br/newihs/pages/loginExterno.iface

from selenium import webdriver

chrome = webdriver.Chrome()
chrome.get("https://www3.honda.com.br/newihs/pages/loginExterno.iface")

chrome.find_element_by_id("formId:codEmpresa").send_keys("Text1")
chrome.find_element_by_id("formId:codUsuario").send_keys("Text2")
chrome.find_element_by_id("formId:senha").send_keys("Text2")
chrome.find_element_by_id("formId:j_id68").click
person ggorlen    schedule 20.07.2018