capturarId = driver.find_element(By.tag_name,"iframe").send_keys('id')
iframe = driver.find_element(by.xpath,"//iframe[@id='"+capturarId+"']")
driver.switch_to.frame(iframe[0])
code and next error type object 'By' has no attribute 'tag_name' please can you help me
You have given as iframe[0], iframe is Webelement not array hence you have to write in below way.