0
votes

AT THE BOTTOM IS THE RELEVANT HTML

So currently I'm transferring over a large amount of data from one iframe to another iframe on a different website. I'm able to copy the data from the first iframe consistently. I switch to the new window and I'm able to interact with the dom and type into other non-iframe elements. However when it gets to this code I get an error

     self.driver.switch_to.frame(driver.find_element_by_id("iframe"))
     self.driver.implicitly_wait(8)
    
     ActionChains(self.driver).key_down(Keys.PAGE_DOWN).key_up(Keys.PAGE_UP).click(self.driver.find_element_by_id(iframe_body)).send_keys(copy).perform()

So this is what I'm running. Initially, I was getting the error of the body element being unfound hence the implicitly wait. Then I got a MoveTargetOutOfBoundsException. So I added the Keys.PAGE_DOWN. At one point I even had ActionChains(driver).move_to_element(iframe_body).perform() Any help getting the keys to type into the iframe is appreciated.

When you inspect the element on the part that is typeable the body appears

Below is the Relevant HTML

<iframe>
 #document
  <html>
    <head>
    </head>
    <body>
    </body>
    <style>
    </style>
 </html>
1
Are you sure iFrame has id="iframe" ? - NarendraR

1 Answers

0
votes

I found the issue. I was clicking other elements on the page before I was switching to the iframe element. For some reason, change frames doesn't work and I just have to click the iframe element directly with an ActionChain