当前位置:网站首页>Selenium chrome disable JS disable pictures

Selenium chrome disable JS disable pictures

2022-06-26 15:41:00 nongcunqq

import requests
from selenium import webdriver
 
options=webdriver.ChromeOptions()
prefs = {
    
              'profile.default_content_setting_values': {
    
                'images': 2,
                'javascript': 2        #2 It means disabled 
                }
 }
options.add_experimental_option('prefs', prefs)
 
driver = webdriver.Chrome(chrome_options=options)
driver.get('http://www.baidu.com')
driver.implicitly_wait(20)

Reference resources
https://blog.csdn.net/lws123253/article/details/90759417

原网站

版权声明
本文为[nongcunqq]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206261515514870.html