#coding=utf8 from selenium import webdriver dr = webdriver.Chrome() #Switch to iframe, it can be name or id, or you can use index directly, dr.switch_to.frame( 0 ) #You can directly locate the iframe by finding various attributes of the iframe dr.switch_to.frame(dr.find_element_by_tag_name( "iframe" ))
#Generally, it is necessary to switch to the main html
dr.switch_to.default_content()