python - 如何使用 python selenium 包打开 chrome webdriver,登录默认用户?

标签 python google-chrome selenium

我想以登录的 chrome 用户身份使用 chrome webdriver,它通常作为一个没有任何 cookie 的普通 chrome 实例启动,并且未登录到 google。 在java上下文中可以找到类似的问题here

最佳答案

在Python中:

chrome_options = Options()
    chrome_options.add_argument("user-data-dir=/location/to/chrome/profile")
    driver = webdriver.Chrome(chrome_options=chrome_options,executable_path='/location/to/chromedriver')

关于python - 如何使用 python selenium 包打开 chrome webdriver,登录默认用户?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39398436/

相关文章:

css - 有没有办法设置 Google Chrome 默认 PDF 查看器的样式

c++ - NACL 不是加载模块吗?

javascript - Chrome 返回 '-0'

java - 无法在 eclipse 中运行脚本

python - 我如何利用 werkzeug.security 的 check_password_hash 函数根据现有的加盐 sha1 密码哈希值验证密码是否正确

python - Python中改变链表分区节点值

python - 无法终止/终止子进程

python - Pandas groupby date month 并在几个月内计算项目

java - 无法使用 Java 使用 Selenium Webdriver 3.0.1 启动 IE8 浏览器

angularjs - 等待页面加载超时