DEV Community

drkhrs
drkhrs

Posted on

I want to download images in a special URL using python selenium. I tried following

download_url = driver.current_url
new_file_name = str(index) + '.jpg'
destination_path = os.path.join(download_path, new_file_name) print(destination_path)
try:
urllib.request.urlretrieve(download_url, destination_path)
except Exception as e:
print(e)

Top comments (0)