# iframe有name或id值
self.driver.switch_to.frame('iframe-name-id')
# iframe沒有name或id值
xf = self.driver.find_element_by_xpath('//iframe[@allowtransparency="true"]')
self.driver.switch_to.frame(xf)
# 跳出當前iframe
self.driver.switch_to.parent_frame()
# 返回最外層iframe
self.driver.switch_to.default_content()