Selenium:检查当前窗口是私有窗口还是普通窗口? [英] Selenium: Check if the current window is a private window or normal window?

查看:89
本文介绍了Selenium:检查当前窗口是私有窗口还是普通窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Selenium网络驱动程序(python,Firefox)中是否有办法检查当前窗口是否处于私有模式(私有窗口以便不会缓存cookie)或者它只是一个普通的窗口?

Is there a way in Selenium web driver (python, Firefox) to check that the current window is in private mode(private window so the cookies won't be cached) or it is just a normal window?

推荐答案

Selenium默认情况下实际上已经运行私有模式。每次通过Selenium启动任何驱动程序时,它都会创建一个全新的匿名配置文件。当然,如果您尚未指定已创建的个人资料。

Selenium actually already runs private mode by default. Every time you start any driver via Selenium it creates a brand new anonymous profile. This of course if you haven't specified an already created profile.

这篇关于Selenium:检查当前窗口是私有窗口还是普通窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆