# iframe有name或id值

self.driver.switch_to.frame('iframe-name-id')

# iframe没有name或id值

使用python处理selenium中的frame切换问题

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()

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-28
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-23
相关资源
相似解决方案