python-selenium设置webdriver隐藏浏览器运行及不加载图片



from selenium import webdriver


# 设置无界面
opt = webdriver.ChromeOptions()
opt.headless = True
opt.add_argument('blink-settings=imagesEnabled=false')  # 设置不加载图片

#opt.add_argument('--ignore-certificate-errors')  # 兼容python默认解释器报错ssl_client_socket_impl.cc [好像不大管用]
#opt.add_argument('--ignore-ssl-errors')

driver = webdriver.Chrome(options=opt)

......





版权声明

本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,可随意转载(O ^ ~ ^ O),别忘了标明转载来源即可。

评论

分享:

支付宝

微信