selenium.common.exceptions.NoSuchFrameException: Message: XXXXX
selenium+python 解决frame定位不到的问题:
本次问题是所在元素处在frame3中,直接定位self.driver.switch_to.frame("frame3")会报标题所示错误。看了页面代码,frame3外层有frame2,frame2外层有frame1,需要层层定位,
self.driver.switch_to.default_content()
self.driver.switch_to.frame("frame1")
self.driver.switch_to.frame("frame2")
self.driver.switch_to.frame("frame3")
问题完美解决!

浙公网安备 33010602011771号