'''
对于alter弹出框,selenium不能直接定位

有三个操作
1.确定 accept
2.取消 dismiss
3.获取文本
因为alter弹出框出现在网页加载完成以后,所以implicity_wait
对他不起作用,这是依然需要time.sleep()
倒包:alt+enter,选择import time
'''
#9.关闭alter弹出框
#获取alter文本
time.sleep(2)
isSucess=derver.switch_to.alert.text
print(isSucess)
#确定
derver.switch_to.alert.accept()

相关文章:

  • 2022-12-23
  • 2019-08-01
  • 2021-11-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-14
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案