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)

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay