【发布时间】:2016-04-17 07:05:08
【问题描述】:
在我使用下面的代码之前,但它不再适用于 firefox 更新。
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
firefoxProfile = FirefoxProfile()
firefoxProfile.set_preference('permissions.default.image', 2)
我也在下面尝试了这个,看起来不错,但是有没有办法在没有附加组件或 3rd 方工具的情况下禁用图像?
from selenium import webdriver
firefox_profile = webdriver.FirefoxProfile()
firefox_profile.add_extension(folder_xpi_file_saved_in + "\\quickjava-2.0.6-fx.xpi")
firefox_profile.set_preference("thatoneguydotnet.QuickJava.startupStatus.Images", 2) ## Turns images off
【问题讨论】:
-
设置
permissions.default.image在 Firefox 66.0.5 上适用于我。
标签: python image selenium selenium-firefoxdriver loadimage