def is_element_in_an_iframe(self, selector, by=By.CSS_SELECTOR):
selector, by = self.__recalculate_selector(selector, by)<EOL>if self.is_element_present(selector, by=by):<EOL><INDENT>return False<EOL><DEDENT>soup = self.get_beautiful_soup()<EOL>iframe_list = soup.select('<STR_LIT>')<EOL>for iframe in iframe_list:<EOL><INDENT>iframe_identifier = None<EOL>if iframe.has_attr('<STR_LIT:name>') and len(iframe['<STR_LIT:name>']) > <NUM_LIT:0>:<EOL><INDENT>iframe_identifier = iframe['<STR_LIT:name>']<EOL><DEDENT>elif iframe.has_attr('<STR_LIT:id>') and len(iframe['<STR_LIT:id>']) > <NUM_LIT:0>:<EOL><INDENT>iframe_identifier = iframe['<STR_LIT:id>']<EOL><DEDENT>else:<EOL><INDENT>continue<EOL><DEDENT>self.switch_to_frame(iframe_identifier)<EOL>if self.is_element_present(selector, by=by):<EOL><INDENT>self.switch_to_default_content()<EOL>return True<EOL><DEDENT>self.switch_to_default_content()<EOL><DEDENT>return False<EOL>
Returns True if the selector's element is located in an iframe.
            Otherwise returns False.