from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver import ChromeOptions
chrome_options = ChromeOptions()
# chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-gpu')
options = Options()
options.add_experimental_option('excludeSwitches', ['enable-automation'])
options.add_experimental_option('useAutomationExtension', False)
options.add_argument("--disable-blink-features")
options.add_argument("--disable-blink-features=AutomationControlled")
executable_path = r'./utils/chromedriver.exe'
bro = webdriver.Chrome(executable_path=executable_path, chrome_options=chrome_options, options=options)
selenium常用配置
最新推荐文章于 2024-09-15 10:30:00 发布