gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 16:10:07 26 4
gpt4 key购买 nike

我想以登录的 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com