selenium添加chrome浏览器插件selenium添加chrome浏览器插件selenium添加chrome浏览器插件selenium添加chrome浏览器插件
  • 首页
  • 博客
  • 书签
  • 文件
  • 分析
  • 登录

selenium添加chrome浏览器插件

发表 admin at 2022年3月14日
类别
  • Python
标签
selenium启动的chrome浏览器是一个空白的浏览器,不带有插件,
需要用到插件时可以先下载好插件的crx文件,在启动时添加进去就可以了

from selenium import webdriver
import selenium.common.exceptions

chrome_options = webdriver.ChromeOptions()
# 设置好应用扩展
extension_path = r'D:\Downloads\steam inventury helper\1.11.1.3_0.crx'
chrome_options.add_extension(extension_path)
# 启动浏览器,并设置好wait
browser = webdriver.Chrome(chrome_options=chrome_options)

browser.get('https://www.sample.com')

发表回复 取消回复

要发表评论,您必须先登录。

类别

  • Cat
  • Python
  • Django
  • Database
  • Html/CSS
  • JavaScript
  • Vue
  • RegExp
  • Maths/AI
  • PHP/Wordpress
  • Practice
  • Linux
  • Windows
  • Android
  • NAS
  • Software
  • Hardware
  • Network
  • SEO
  • English
  • Games
  • Recipes
  • General
  • Memorandum
  • Essays
  • 未分类

归档

©2015-2023 艾丽卡 Blog support@alaica.com
      ajax-loader