Python Forum
Unable to select iframe using selenium
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to select iframe using selenium
#1
I am trying to automate login process for web page https://hpconnected.com/en/us, login form is an iframe and I am trying to switch to iframe using the id, but it does not work at all. Any help will be appreciated.

from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome(executable_path=r"C:\test\chromedriver.exe")
driver.get('https://www.hpconnected.com/us/en')
driver.find_element_by_link_text("Sign In").click()
driver.implicitly_wait(20)
#driver.switch_to_frame(driver.find_element_by_tag_name("iframe"))
iframe = driver.find_element_by_id('webauthPanelIFrame')
driver.switch_to.frame(iframe)
username = driver.find_element_by_name("email")
driver.implicitly_wait(20)
username.send_keys("test@ABC.com")
Reply
#2
Please edit your post so that the code is contained in Python code tags. You can find help here.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Selenium press "select option" button (SOLVED) kucingkembar 0 720 Aug-10-2023, 11:49 AM
Last Post: kucingkembar
  Selenium Parsing (unable to Parse page after loading) oneclick 7 6,006 Oct-30-2020, 08:13 PM
Last Post: tomalex
  To select only the latest value with Selenium codessu 2 1,949 May-16-2020, 03:51 AM
Last Post: codessu
  selenium click in iframe fails 3Pinter 6 5,117 Apr-29-2020, 12:59 PM
Last Post: Larz60+
  Selenium: accessing a drop-down menus without select tags ClassicalSoul 0 2,059 Apr-19-2020, 03:53 PM
Last Post: ClassicalSoul
  How to find which frame/iframe my element belongs to? smaria 1 2,056 Nov-18-2019, 09:21 PM
Last Post: Larz60+
  Unable to access javaScript generated data with selenium and headless FireFox. pjn4 0 2,544 Aug-04-2019, 11:10 AM
Last Post: pjn4
  Looping actions in an iframe using Selenium on Python amyd 3 3,018 Mar-06-2019, 08:31 PM
Last Post: Larz60+
  scraping with multiple iframe jansky 1 4,201 Nov-09-2018, 11:12 AM
Last Post: snippsat
  unable to load file using python selenium purnima1 4 6,514 Dec-12-2017, 04:04 PM
Last Post: hshivaraj

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020