Since the src image link gives you a random new captcha image when you open this link!
Instead of downloading a file from an src image, you can take a screenshot to get it in a browser. However, you need to download Pillow ( pip install Pillow ) and use it as indicated in this answer :
from PIL import Image from selenium import webdriver def get_captcha(driver, element, path):
(Note that I modified the code a bit so that it can work in your case.)
source share