Selenium downloading different captcha image than the one in browser
<p>I am trying to download a captcha image with Selenium, however, I'm getting a different image downloaded than the one showed in the browser.
If I try to download the image again, without changing the browser, I get a different one. </p>

<p>Any thoughts?</p>

<pre><code>from selenium import webdriver
import urllib


driver = webdriver.Firefox()
driver.get("http://sistemas.cvm.gov.br/?fundosreg")

# Change frame.
driver.switch_to.frame("Main")


# Download image/captcha.
img = driver.find_element_by_xpath(".//*[@id='trRandom3']/td[2]/img")
src = img.get_attribute('src')
urllib.request.urlretrieve(src, "captcha.jpeg")
</code></pre>