Python-Selenium中chromeDriver限制图片和Javascript加载
Posted zhangdingqu的博客
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python-Selenium中chromeDriver限制图片和Javascript加载相关的知识,希望对你有一定的参考价值。
我们有的时候使用Selenium会希望能够限制图片和Javascript执行,从而提高网页加载速度。
options=webdriver.ChromeOptions() prefs={ ‘profile.default_content_setting_values‘: { ‘images‘: 2, ‘javascript‘:2 } } options.add_experimental_option(‘prefs‘,prefs) browser = webdriver.Chrome(chrome_options=options) browser.get(‘http://www.c‘s/‘)
参考网址:https://blog.csdn.net/karwik/article/details/78573917
以上是关于Python-Selenium中chromeDriver限制图片和Javascript加载的主要内容,如果未能解决你的问题,请参考以下文章