title: How take XPATH inside a iframe?
body: <p>Im trying to get the XPATH inside a iframe called "gadget_6" <a href="https://i.stack.imgur.com/l3NFN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/l3NFN.png" alt="called &quot;gadget_6&quot;"></a></p>
  
  <p>i need the xpath of select div. Using selenium i do:</p>
  
  <pre><code>self.change_frame('__gadget_6') #Change to the correct iframe
  </code></pre>
  
  <p>after that, i try to do:</p>
  
  <pre><code>self.selec_orgvdc = self.driver.find_element(By.XPATH,'/html/body/div[5]/div/div/div/table/tbody/tr/td/div')
  </code></pre>
  
  <p>for posteriorly do:</p>
  
  <pre><code>self.selec_orgvdc.click
  </code></pre>
  
  <p>but i obtain the error:</p>
  
  <pre><code>InvalidSelectorException: Message: invalid selector: Unable to locate an element with the xpath expression /html/body/div[5]/div/div/div/table/tbody/tr/td/div because of the following error:
  SyntaxError: Failed to execute 'evaluate' on 'Document': The string '/html/body/div[5]/div/div/div/table/tbody/tr/td/div' is not a valid XPath expression.
  </code></pre>
  
  <p>Someone can help me?</p>
  
  <p>New modification:</p>
  
  <pre><code>self.change_frame('__gadget_6')
  time.sleep(4)
  self.logger.info("Buscando orgvdc")
  #self.selec_orgvdc = self.driver.find_element(By.CSS_SELECTOR,'div.GN4Y2ATIMD table div.gwt-Label')
  self.selec_orgvdc = self.driver.find_element(By.XPATH,'//div[5]/div/div/div/table/tbody/tr/td/div')
  self.logger.info("Encontrado!")
  </code></pre>