【发布时间】:2015-09-29 06:45:18
【问题描述】:
在这个编辑器中,当你输入内容时,所有内容都转到标签<p>,但系统无法识别/html/body/p,所以我使用/html/body或切换到活动元素,两者都不起作用。
driver.switch_to_frame(driver.find_element_by_xpath("//iframe[contains(@title,'ALT')]"))
driver.switch_to_active_element()
time.sleep(1)
driver.execute_script("document.body.innerHTML = '<br>'")
webElement = driver.find_element_by_xpath("/html/body")
webElement.send_keys(developreqTestData["inputOne"][inputNotes])
time.sleep(1)
driver.switch_to_default_content()
time.sleep(0.5)
【问题讨论】:
-
我使用 PhantomJS 1.9.2
标签: python selenium iframe selenium-webdriver automation