title: Selenium: How to disable image loading with firefox and python?
body: <p>I have read similar questions and one was supposed to be the answer, but when I tried it, it only gave a partial solution.
  I refer to this question: <a href="https://stackoverflow.com/questions/25214473/disable-images-in-selenium-python">Disable images in Selenium Python</a></p>
  
  <p>My problem is that I tried the solution and some of the images do not appear, but images that arrive from:</p>
  
  <pre><code>&lt;img href="www.xxx.png"&gt; 
  </code></pre>
  
  <p>Are being loaded.
  Is there a way to tell firefox/selenium not to get it?
  If not, is there a way to discard it from the dom element that I get back, via:</p>
  
  <pre><code>self._browser.get(url)
  content=self._browser.page_source
  </code></pre>
  
  <p>for example by doing some kind of find replace on the dom tree?
  The browser configuration is the same browser from the previous question:</p>
  
  <pre><code>    firefox_profile = webdriver.FirefoxProfile()
      # Disable CSS
      firefox_profile.set_preference('permissions.default.stylesheet', 2)
      # Disable images
      firefox_profile.set_preference('permissions.default.image', 2)
      # Disable Flash
      firefox_profile.set_preference('dom.ipc.plugins.enabled.libflashplayer.so', 'false')
      # Set the modified profile while creating the browser object
      self._browser = webdriver.Firefox(firefox_profile=firefox_profile)
  </code></pre>
  
  <p><br>
  <strong>Update</strong>:</p>
  
  <p>I kept on digging and what I learned is that if I inspect the text document that the selenium/firefox combo did I see that, it didn't bring the images and kept them as links.
  But when I did:</p>
  
  <pre><code>self._browser.save_screenshot("info.png") 
  </code></pre>
  
  <p>I got a 24 mega file with all the img links loaded.<br/>
  Can anyone explain to me this matter?<br/>
  Thanks!</p>