from selenium.webdriver.chrome.options import Options

options = Options()
# 禁止图片和css加载
prefs = {"profile.managed_default_content_settings.images": 2, 'permissions.default.stylesheet': 2}
options.add_experimental_option("prefs", prefs)
# 无头模式
options.add_argument('--headless')

7636f8b1cd91c50fcc40571dc684bbe4ae7533ca
<mask token>

<mask token>
options.add_experimental_option('prefs', prefs)
options.add_argument('--headless')

<mask token>
options = Options()
prefs = {'profile.managed_default_content_settings.images': 2,
    'permissions.default.stylesheet': 2}
options.add_experimental_option('prefs', prefs)
options.add_argument('--headless')

from selenium.webdriver.chrome.options import Options
options = Options()
prefs = {'profile.managed_default_content_settings.images': 2,
    'permissions.default.stylesheet': 2}
options.add_experimental_option('prefs', prefs)
options.add_argument('--headless')

from selenium.webdriver.chrome.options import Options

options = Options()
# 禁止图片和css加载
prefs = {"profile.managed_default_content_settings.images": 2, 'permissions.default.stylesheet': 2}
options.add_experimental_option("prefs", prefs)
# 无头模式
options.add_argument('--headless')
