如何在硒驱动程序参数中使用硒实验选项?

时间:2020-08-26 05:54:05

标签: python scrapy selenium-chromedriver web-crawler

from shutil import which

SELENIUM_DRIVER_NAME = 'chrome'
SELENIUM_DRIVER_EXECUTABLE_PATH = which('chromedriver')
prefs = {"profile.managed_default_content_settings.images": 2}
SELENIUM_DRIVER_ARGUMENTS=['--incognito',prefs]
DOWNLOADER_MIDDLEWARES = {
'scrapy_selenium.SeleniumMiddleware': 800
}

https://user-images.githubusercontent.com/40191872/91153176-80b92680-e6dd-11ea-8b5d-b1e9d77cd049.png 这是我的代码,我想在网站加载过程中添加用于禁用图像的首选项...但是我不明白该怎么办?请为此提供帮助

0 个答案:

没有答案