34使用selenium浏览器出现Chrome正受到自动测试软件的控制”和“请停用以开发者模式运行的扩展程序
本人使用就是看着不爽
版本:4.9.0
解决方法
chrome_options = webdriver.ChromeOptions() chrome_options.add_experimental_option("excludeSwitches", ['enable-automation']) driver = webdriver.Chrome(chrome_options=chrome_options)
# @Time : 2023/7/12 # @Author : bgm # @File : selenium-py.py # Version: 4.10.0 from selenium import webdriver from selenium.webdriver.chrome.service import Service options = webdriver.ChromeOptions() options.add_argument('headless') # 无头 service = Service() driver = webdriver.Chrome(service=service, options=options) # driver.get("https://www.facebook.com/") driver.get("https://www.baidu.com/") data = driver.page_source print(data)
本文来自博客园,作者:__username,转载请注明原文链接:https://www.cnblogs.com/code3/p/16996031.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步