     [Answers](https://scrapfly.io/blog)   /  [python](https://scrapfly.io/blog/tag/python)   /  [How to block image loading in Selenium?](https://scrapfly.io/blog/answers/how-to-block-image-loading-in-selenium)   # How to block image loading in Selenium?

 by [Bernardas Alisauskas](https://scrapfly.io/blog/author/bernardas) Nov 25, 2022 1 min read [\#python](https://scrapfly.io/blog/tag/python) [\#selenium](https://scrapfly.io/blog/tag/selenium) 

 [  ](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-block-image-loading-in-selenium "Share on LinkedIn")    

 

 

When web scraping using Selenium we are wasting a lot of connection bandwidth for loading images. Unless we're capturing screenshots our data scrapers don't need to actually see the various visuals like images.

To block images in Selenium we have two options either add `imagesEnabled=false` flag or set `profile.managed_default_content_settings.images` value to `2`:

python```python
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.headless = True

chrome_options = webdriver.ChromeOptions()
# this will disable image loading
chrome_options.add_argument('--blink-settings=imagesEnabled=false')
# or alternatively we can set direct preference:
chrome_options.add_experimental_option(
    "prefs", {"profile.managed_default_content_settings.images": 2}
)

driver = webdriver.Chrome(options=options, chrome_options=chrome_options)
driver.get("https://www.twitch.tv/directory/game/Art")
driver.quit()
```





 

    



Scale Your Web Scraping

Anti-bot bypass, browser rendering, and rotating proxies, all in one API. Start with 1,000 free credits.

  No credit card required  1,000 free API credits  Anti-bot bypass included 

 [Start Free](https://scrapfly.io/register) [View Docs](https://scrapfly.io/docs/onboarding) 

 Not ready? Get our newsletter instead. 

 

## Explore this Article with AI

 [ ChatGPT ](https://chat.openai.com/?q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-block-image-loading-in-selenium) [ Gemini ](https://www.google.com/search?udm=50&aep=11&q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-block-image-loading-in-selenium) [ Grok ](https://x.com/i/grok?text=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-block-image-loading-in-selenium) [ Perplexity ](https://www.perplexity.ai/search/new?q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-block-image-loading-in-selenium) [ Claude ](https://claude.ai/new?q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-block-image-loading-in-selenium) 



 ## Related Articles

 [  

 python nodejs 

### How to use Headless Chrome Extensions for Web Scraping

In this article, we'll explore different useful Chrome extensions for web scraping. We'll also explain how to install Ch...

 

 ](https://scrapfly.io/blog/posts/how-to-use-browser-extensions-with-playwright-puppeteer-and-selenium) [  

 python crawling 

### Intro to Web Scraping Images with Python

In this guide, we’ll explore how to scrape images from websites using different methods. We'll also cover the most commo...

 

 ](https://scrapfly.io/blog/posts/how-to-web-scrape-images-from-websites-python) [  

 blocking 

### How to Avoid Scraper Blocking when Scraping Images

Introduction to scraper blocking when it comes to image scraping. What are some popular scraper blocking techniques and ...

 

 ](https://scrapfly.io/blog/posts/how-to-avoid-blocking-scraping-images) 

  ## Related Questions

- [ Q How to find elements by XPath in Selenium ](https://scrapfly.io/blog/answers/how-to-find-elements-by-xpath-in-selenium)
- [ Q How to scrape images from a website? ](https://scrapfly.io/blog/answers/how-to-scrape-images-from-website)
- [ Q Selenium: chromedriver executable needs to be in PATH? ](https://scrapfly.io/blog/answers/selenium-chromedriver-in-path)
- [ Q How to block resources in Selenium and Python? ](https://scrapfly.io/blog/answers/how-to-block-resources-in-selenium)
 
  



   



 Run headless browsers at scale, **1,000 free credits** [Start Free](https://scrapfly.io/register)