试图在确实。ca上练习硒。下面介绍了我的步骤:
将驱动程序焦点切换到“ window-pop”之后,我无法找到元素。
这里是所有使用的链接:
答案 0 :(得分:0)
尝试一下
这些字段位于嵌套的iframe中。
aarch64
答案 1 :(得分:0)
点击立即申请 按钮:
后,您可以使用此代码有两个iframe,为了与新打开的弹出窗口进行交互,您将不得不切换到两个框架。
代码:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Chrome(executable_path = r'D:/Automation/chromedriver.exe')
driver.maximize_window()
driver.get("https://www.indeed.ca/jobs?q=it%20support&l=Toronto%2C%20ON&vjk=837c0cbbf26a68a7")
wait = WebDriverWait(driver, 10)
apply_now = wait.until(EC.element_to_be_clickable((By.XPATH, "//span[text()='Apply Now']/ancestor::a")))
apply_now.click()
wait.until(EC.frame_to_be_available_and_switch_to_it((By.CSS_SELECTOR,"div.indeed-apply-bd>iframe")))
driver.switch_to.frame(driver.find_element_by_css_selector("iframe[src^='https://apply.indeed.com/indeedapply/resumeapply?']"))
Name = wait.until(EC.element_to_be_clickable((By.ID, "input-applicant.name")))
Name.send_keys("Vijay")