
Language/Python
파이썬(Python) - Selenium iframe 제어하기
파이썬에서 selenium을 활용해서 자동화 작업시에 iframe 요소에 접근하려고 할때 접근을 못하는 경우가 있습니다. 이럴 경우에는 switch_to.frame()을 이용해서 지정된 프레임으로 포커스를 전환하고 작업을 완료후에 switch_to.default_content()를 이용해서 다시 기본 프레임으로 전환시켜 해결을 할 수 있습니다. # iframe에 접근 driver.switch_to.frame('frame_name') # # iframe에 접근하여 작업 # # 기본 프레임으로 다시 전환 driver.switch_to.default_content() 참고자료 https://choihyuunmin.tistory.com/83