栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

保存chrome cookie selenium

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

保存chrome cookie selenium

您需要在所需的用户个人资料下运行Chrome。默认情况下,Selenium
Web驱动程序将创建一个临时配置文件。如果您为其提供用户个人资料,则该个人资料将保留,并且如果未将Chrome设置为删除cookie,则会创建通常会为用户创建cookie的所有登录信息。

有关详细信息,请参见Selenium
chromedriver网站

Use custom profile (also called user data directory)By default, ChromeDriver will create a new temporary profile for each session. At times you may want to set special preferences or just use a custom profile altogether. If the former, you can use the 'chrome.prefs' capability (described later below) to specify preferences that will be applied after Chrome starts. If the latter, you can use the user-data-dir Chrome command-line switch to tell Chrome which profile to use:ChromeOptions options = new ChromeOptions();options.addArguments("user-data-dir=/path/to/your/custom/profile");You can create your own custom profile by just running Chrome (on the command-line or through ChromeDriver) with the user-data-dir switch set to some new directory. If the path doesn't exist, Chrome will create a new profile in the specified location. You can then modify the profile settings as desired, and ChromeDriver can use the profile in the future. Open chrome://version in the browser to see what profile Chrome is using.


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/436064.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号