首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >硒中铬的刻蚀

硒中铬的刻蚀
EN

Stack Overflow用户
提问于 2022-04-30 23:55:31
回答 1查看 240关注 0票数 0

尝试使用目标铬配置文件运行selenium脚本。但是一旦我运行了这个脚本,它就不会从目标配置文件开始,而是以一个新的概要文件开始。这是我的密码:

代码语言:javascript
复制
# import selenium common driver
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
import time

# for specified chrome profile
from selenium.webdriver.chrome.options import Options

# wait page until targeted element loaded
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException

# undetectable module
import undetected_chromedriver.v2 as uc # use pip install undetected-chromedriver

if __name__ == '__main__':
    options = uc.ChromeOptions()

    # another way to set profile is the below (which takes precedence if both variants are used
    options.add_argument(r'--user-data-dir=C:\Users\Fadli\AppData\Local\Google\Chrome\User Data\Profile 4')

    # just some options passing in to skip annoying popups
    options.add_argument(r'--no-first-run --no-service-autorun --password-store=basic')
    driver = uc.Chrome(options=options)  # version_main allows to specify your chrome version instead of following chrome global version

    driver.get('https://nowsecure.nl')
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-05-01 14:09:10

如果有帮助的话,试试下面的一行

代码语言:javascript
复制
# another way to set profile is the below (which takes precedence if both variants are used
options.add_argument(r'--user-data-dir=C:\Users\Fadli\AppData\Local\Google\Chrome\User Data')
options.add_argument(r'--profile-directory=Profile 4')

您可以在这里查看以获得更多的参考。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72073046

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档