title: Download image with selenium python
body: <p>I want get captcha image from browser. I have got a url of this picture, but the this picture changes each updated time (url is constant).</p>
  
  <p>Is there any solution to get picture from browser (like 'save picture as' button)? </p>
  
  <p>From the other hand, I think it should be work:</p>
  
  <ol>
  <li>get screenshot of the browser</li>
  <li>get position of picture</li>
  <li>crop captcha from screenshot using opencv</li>
  </ol>
  
  <p>link of the dynamic capcha - <a href="https://moscowsg.megafon.ru/ps/scc/php/cryptographp.php?PHPSESSID=mfc540jkbeme81qjvh5t0v0bnjdr7oc6&amp;ref=114&amp;w=150" rel="noreferrer">link</a></p>
  
  <p>The problem was solved via screenshot:</p>
  
  <pre><code>browser.save_screenshot('screenshot.png')
  img = browser.find_element_by_xpath('//*[@id="cryptogram"]')
  loc = img.location
  
  image = cv.LoadImage('screenshot.png', True)
  out = cv.CreateImage((150,60), image.depth, 3)
  cv.SetImageROI(image, (loc['x'],loc['y'],150,60))
  cv.Resize(image, out)
  cv.SaveImage('out.jpg', out)
  </code></pre>
  
  <p>Thanks</p>