selenium(2): After the environment is built, the problems encountered in the initial operation

Check if the build is successful.

Question 1: When running, an error is reported: Please disable the extension running in developer mode

The error is as follows:

Reason: The version number of chromedriver is too low.

Solution: The chromedriver corresponding to the chrome version should be installed

Problem two: chrome is being controlled by automated testing software.

Add a parameter to the browser configuration to ignore this warning message

option = webdriver.ChromeOptions()
option.add_argument('disable-infobars')

Reference Code

# coding:utf-8
from selenium import webdriver

# 加启动配置
option = webdriver.ChromeOptions()
option.add_argument('disable-infobars') # 打开chrome浏览器 driver = webdriver.Chrome(chrome_options=option) driver.get("https://www.baidu.com")

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325216502&siteId=291194637