无头配置

from selenium.webdriver import Chrome
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select # 下拉列表 <select>
import time

# 配置无头信息
from selenium.webdriver.chrome.options import Options

opt = Options()
opt.add_argument("--headless") # 头短小
opt.add_argument("--disable-gpu")
web = Chrome(options=opt)
web.get('https://www.endata.com.cn/BoxOffice/BO/Year/index.html')
posted @ 2023-08-03 22:27  严永富  阅读(4)  评论(0)    收藏  举报