-1

I am new to programing in general and was tasked with downloading an image using python, however I am having trouble getting any image. For an example I am using:

urllib.urlretrieve(i.imgur.com/oFwqoz6.png, Meme.png)

and always receive the say error which is:

IOError: [Errno 2] No such file or directory: 'i.imgur.com/oFwqoz6.png'

this baffles me due to the link working in the web browser, am I missing something simple here?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Ughhhhhh
  • 3
  • 2

1 Answers1

0

As simple as this:

import urllib

urllib.urlretrieve("http://i.imgur.com/oFwqoz6.png", "local-filename.png")

This is a simple task for Python and there are many ways to solve this, after I searched for a few seconds I found many answer for this question:

How to save an image locally using Python whose URL address I already know?

Downloading a picture via urllib and python

What I'm trying to say is that you should try to research a little bit more before formulating a question. Always post code that works, to make sure we can replicate any error you're getting.

Community
  • 1
  • 1
gglasses
  • 826
  • 11
  • 30
  • Wow, that was simple, thank you for the help. I'll make sure to research a bit more before posting a question again. – Ughhhhhh Aug 02 '15 at 02:47