Issue
I want create an account on ProtonMail.
But when I sign up, I select the user, but I can not send anything to it.
And it gives the following error:
ElementNotInteractableException: Message: Element is not reachable by keyboard. address page='https://account.protonmail.com/signup?language=en'
user=d.find_element_by_xpath('//*[@id="username"]')
print(user.tag_name) # Is input
user.send_keys('username') # Give an error
I also used Action Chains, but the problem was not solved.
Solution
There are 2 issues here:
2 elements located by //*[@id="username"]
XPath
The element you want to access is inside iframe.
Try this:
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
wait(driver, 10).until(EC.frame_to_be_available_and_switch_to_it(driver.find_element_by_xpath('//iframe')))
user=d.find_element_by_xpath('//body[@class="color-norm bg-norm sign-layout-container"]//*[@id="username"]')
user.send_keys('username')
Answered By - Prophet Answer Checked By - Terry (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.