在web测试中,我计划获取iframe(/htme/body/p)的内容,有可能吗?在
我使用这个方法来设置iframe的内容:
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 = '%s'" % recurWorkflowTestData["inputEditor"][inputNotes]))
time.sleep(1)
driver.switch_to_default_content()
要遵循相同的逻辑,可以将
document.body.innerHTML
取回:相关问题 更多 >
编程相关推荐