【web自动化】指定chromedriver以及chrome路径

selenium自动化,指定chromedriver,以及chrome路径
===对应这篇文章,可以点击查看,详情===

python 复制代码
from selenium import webdriver

def get_driver():
    # 获取配置对象
    option = webdriver.ChromeOptions()
    option.add_experimental_option("detach", True)
    # 去掉自动化标识
    option.add_experimental_option('excludeSwitches', ['enable-automation'])
    option.add_argument('--disable-blink-features=AutomationControlled')
    # 关闭保存密码弹窗
    prefs = {}
    prefs['credentials_enable_service'] = False
    prefs['profile.password_manager_enabled'] = False
    option.add_experimental_option('prefs', prefs)
    # 驱动chromedriver路径
    driver_path = 'X:\Program Files (x86)\Chrome\ChromeCore\chromedriver_win32\chromedriver.exe'

    # 指定 Chrome 浏览器的可执行文件路径
    option.binary_location = r'X:\Program Files (x86)\Chrome\ChromeCore\ChromeCore.exe'

    driver = webdriver.Chrome(options=option, executable_path=driver_path)
    driver.implicitly_wait(10)
    time.sleep(1)
    driver.get('https://www.baidu.com')
    # return driver

get_driver()
相关推荐
喵喵匠8 小时前
一份 Markdown 发十个平台:cspub 一稿多投
自动化·markdown·效率工具·仓颉·cli工具
小杨爱科普10 小时前
制造业上自动化改造,改造部分的专利到底归谁
运维·经验分享·自动化
afumu13 小时前
把五个网页版 AI 拉进同一个群聊:不用 API key 的多 Agent 编排
人工智能·chrome·typescript
yurenshi166816 小时前
多平台内容发布的工程化实践:模板、校验与排期自动化(2026)
自动化·矩阵运营·内容发布
东莞市壹星自动化设备有限公司2 天前
透明圆瓶内部特征怎样定位:折射追踪与近远相位分支
嵌入式硬件·自动化·需求分析·几何学·骨骼绑定
BioTender2 天前
Xaira 发布 X-Automate:将物理 AI 与智能体 AI 引入实验室自动化
运维·人工智能·自动化
其实防守也摸鱼2 天前
个人学习 Pwn 思路:从基础到漏洞利用的进阶路径
大数据·前端·人工智能·chrome·算法·安全·网络安全
天远API2 天前
零信任架构实战:基于天远运营商三要素详版V即时版构建自动化消费电子大促电商平台高价值权益秒杀与优惠券防羊毛高并发实名核验网关
运维·人工智能·架构·自动化
木头左3 天前
【Python】不点浏览器发博客:逆向 CSDN 创作中心接口做 md-publish 技能
python·自动化·api
lisw053 天前
智能化机器人系统的模块化设计自动化!
机器学习·机器人·自动化