PYTHON Selenium 如何控制网页弹出选择窗口?
python吧
全部回复
仅看楼主
level 4
BI4UVB😘
楼主
如图片所示,在双击上面的input框后会弹出一个选择框,双击要选择的条款或是单击条款并点确定,会填入上面的INPUT框,请教吧内大神,如何用Selenium实现选择弹出窗口中的内容并点击确定按钮?
注:在弹出选择窗口后,IE的F12就按不出来了,无法用鼠标确定窗口控件。
2019年08月26日 13点08分
1
level 4
BI4UVB😘
楼主
大神赐教
2019年08月26日 23点08分
2
level 8
不二°
百度,selenium如何处理alert窗口
2019年08月27日 00点08分
3
BI4UVB😘
已经试了,deiver.switch_to.alert(),报错没有找到alert窗口
2019年08月27日 00点08分
不二°
@BI4UVB😘
居然不是alert窗口吗…还有一个叫什么窗口来着,你再搜下,想不起来了
2019年08月27日 01点08分
BI4UVB😘
@不二°
你是说如下部分中的prompt吗?
2019年08月27日 02点08分
BI4UVB😘
webdriver 中处理JavaScript 所生成的alert、confirm 以及prompt 是很简单的。具体思路是使用switch_to.alert()方法定位到alert/confirm/prompt。然后使用text/accept/dismiss/send_keys 按需进行操做。好像是要用switch_to.alert()先跳过去的,但是跳转报错找不到,还有其它办法吗?
2019年08月27日 03点08分
level 4
BI4UVB😘
楼主
已经试了,deiver.switch_to.alert(),报错没有找到alert窗口
2019年08月27日 00点08分
4
level 4
BI4UVB😘
楼主
已经试了,deiver.switch_to.alert(),报错没有找到alert窗口
2019年08月27日 01点08分
5
level 4
BI4UVB😘
楼主
大神赐教
2019年08月27日 05点08分
6
mmmmmc1024
楼主,这个问题后来怎么解决的?
2020年03月20日 12点03分
BI4UVB😘
@mmmmmc1024
木的解决,度娘拟态框
2020年03月20日 12点03分
mmmmmc1024
@BI4UVB😘
好的,我试试。谢谢。
2020年03月20日 14点03分
level 5
chendylan680
用
2020年03月20日 13点03分
8
level 5
chendylan680
chrome
2020年03月20日 13点03分
9
level 1
LokiFunny
如果不是alert弹窗,那看看代码是不是iframe弹窗,直接搜frame就能搜出来用swicth_to.frame,或者是div弹窗就更简单。
2020年06月10日 01点06分
11
level 1
15and16
https://blog.csdn.net/xiaofeixia666888/article/details/108223993
这一位大神的可以,但是复制时要修改一下代码(dr改成driver)
2020年12月25日 08点12分
12
1