Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 切换到同一窗口内的弹出窗口_Python_Selenium - Fatal编程技术网

Python 切换到同一窗口内的弹出窗口

Python 切换到同一窗口内的弹出窗口,python,selenium,Python,Selenium,在chrome中编写selenium automation时,我如何处理出现在同一窗口中的弹出窗口?查看屏幕截图 是操作系统对话框还是浏览器?如果是浏览器弹出窗口,您可以尝试将其作为警报处理。通过使用driver.switchTo().alert切换到它,然后发送键和接受/拒绝警报。这不是通过driver.switchTo().alert处理的JS警报。。他没有提到它。这就是为什么我要问你同意,OP没有提到

在chrome中编写selenium automation时,我如何处理出现在同一窗口中的弹出窗口?查看屏幕截图


是操作系统对话框还是浏览器?如果是浏览器弹出窗口,您可以尝试将其作为警报处理。通过使用driver.switchTo().alert切换到它,然后发送键和接受/拒绝警报。

这不是通过
driver.switchTo().alert处理的JS警报。
。他没有提到它。这就是为什么我要问你同意,OP没有提到