栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

chrome正受到自动测试软件的控制 selenium 4.0 修改源码解决

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

chrome正受到自动测试软件的控制 selenium 4.0 修改源码解决

python安装目录下.Libsite-packagesseleniumwebdriverchromiumoptions.py

文件中的第34行

# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR ConDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.

import base64
import os
from typing import List, NoReturn, Union

from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.common.options import ArgOptions


class ChromiumOptions(ArgOptions):
    KEY = "goog:chromeOptions"

    def __init__(self):
        super(ChromiumOptions, self).__init__()
        self._binary_location = ''
        self._extension_files = []
        self._extensions = []
        self._experimental_options = {'excludeSwitches':['enable-automation']}
        self._debugger_address = None

将 self._experimental_options = {} 修改为self._experimental_options = {'excludeSwitches':['enable-automation']}

不修改源码的解决方法参照如下链接:chrome正受到自动测试软件的控制 浏览器版本V76以及以上disable-infobars参数失效不起作用python_wsbl52006的专栏-CSDN博客问题: python+selenium 跑UI自动化时谷歌浏览器显示“chrome正受到自动测试软件的控制”谷歌浏览器版本在V75以及以下解决办法如下:from selenium import webdriveroptons=webdriver.ChromeOptions()optons.add_argument('disable-infobars')driver=webdri...https://blog.csdn.net/wsbl52006/article/details/105459850?spm=1001.2014.3001.5501

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

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

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