使用python selenium禁用网络选项卡上的缓存(自动化)
我需要使用selenium python禁用网络选项卡上的缓存。尝试了以下方法,但没有任何效果使用python selenium禁用网络选项卡上的缓存(自动化),python,selenium,google-chrome-devtools,Python,Selenium,Google Chrome Devtools,我需要使用selenium python禁用网络选项卡上的缓存。尝试了以下方法,但没有任何效果 options = webdriver.ChromeOptions() options.add_argument("--incognito") options.add_argument('--disable-application-cache') options.add_argument("--
options = webdriver.ChromeOptions()
options.add_argument("--incognito")
options.add_argument('--disable-application-cache')
options.add_argument("--disk-cache-size=0")
options.add_argument("--disk-cache-dir=/dev/null")
options.add_argument("--disable-gpu")
d = DesiredCapabilities.CHROME
d['goog:loggingPrefs'] = {'browser': 'ALL'}
- 尝试以匿名模式打开URL,但我仍然必须打开devtools并手动禁用缓存
driver.execute_cdp_cmd("Network.setCacheDisabled", {"cacheDisabled":True})