driver.switch_to.frame(driver.find_element_by_tag_name("iframe"))
assuming that the driver is a healthy instance of a web driver. To continue with the default content, write the below code:
driver.switch_to.default_content()
EDIT: When you have switched to the needed frame, locate your web element. I guess (but not sure) that in your case this will be an HTML/body, so you can do as shown below:
el = driver.find_element_by_xpath('html/body')
It should be fine. And then you should perform the following:
el.send_keys('keys_to_send')
EDIT2: Before sending keys you may have to focus on the element (click should perform the action, and then a child element should appear). Or you can just place the below code:
driver.execute_script('document.body = "%s"' % text_var)