0

I am trying to login to https://www.auditanalytics.com/0002/authentication.php to the website using python selenium package . When I pass the email using send keys method I am getting the following ERROR .

WebDriverException: Message: target frame detached
  (Session info: MicrosoftEdge=102.0.1245.44)

I just need a solution which I can pass email id and password .

Here is my code

exe_path="msedgedriver.exe"
browser=webdriver.Edge(executable path=exe_path)
browser.get("https://www.auditanalytics.com/0002/authentication.php")
browser.switch_to.frame(browser.find_element_by_tag_name("iframe"))
username=browser.find_element_by_xpath('//*[@id="email"]')
username.send_keys("[email protected]")
password=browser.find_element_by_xpath('//*[@id="password"]')
password.send_keys("test")
3
  • Your elements are not in an iframe. Commented Jun 20, 2022 at 7:50
  • Even the other option is not working. Commented Jun 20, 2022 at 9:08
  • I have tried without the iframe option and it is not working. Commented Jun 20, 2022 at 12:22

1 Answer 1

1
wait = WebDriverWait(browser, 20)
browser.get("https://www.auditanalytics.com/0002/authentication.php")
wait.until(EC.element_to_be_clickable((By.CSS_SELECTOR, '#CybotCookiebotDialogBodyButtonAccept'))).click()
username=wait.until(EC.element_to_be_clickable((By.XPATH, '//*[@id="email"]')))
username.send_keys("[email protected]")
password=wait.until(EC.element_to_be_clickable((By.XPATH, '//*[@id="password"]')))
password.send_keys("test")

Handle the pop up accept all cookies and then proceed to send keys to the element.

Import:

from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait 
from selenium.webdriver.support import expected_conditions as EC
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.