Python Selenium Python selenium solves the problem of iframe switching 1 iframe = browser.find_element_by_xpath('//iframe[contains(@name, "m2k")]') enter iframe 1 browser.switch_to_frame(iframe1) exit iframe 1 browser.switch_to_default_content()