2

How to Disable The load of images in chrome

browser.get("chrome://settings/content/images")
time.sleep(5)
images = browser.find_element_by_id('addSite')
images.click()
text = browser.find_element_by_css_selector("[id='input']")
text.send_keys("https://www.instagram.com/")
accept = browser.find_element_by_xpath("//button[text()='Añadir']")
accept.click() 

i was trying to go to the settings page in chrome and click in blocked sites and add instagram, so it will block the images in instagram, but it cant find the buttons on the page. Anyone knows another way? i tried to use an extension but its .crx and chrome only likes .crx3

0

1 Answer 1

2
option = webdriver.ChromeOptions()
chrome_prefs = {}
option.experimental_options["prefs"] = chrome_prefs
chrome_prefs["profile.default_content_settings"] = {"images": 2}
chrome_prefs["profile.managed_default_content_settings"] = {"images": 2}
browser = webdriver.Chrome(chrome_options=option)
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.