0

I am downloading an image from a given url via urllib by using the

urllib.urlretrieve(ImageUrl,ImageName)

My question is: is it possible to clear cache using urllib before downloading the image or do I have to first browse to image url,clear cache, then download the image via urllib.urlretrieve? I am using Python 2.7 ; browser: Chrome

Thanks in advance.

Elias Shourosh
  • 89
  • 3
  • 14

1 Answers1

1

You can try:

urllib.urlcleanup()

It clears the cache that may have been built up by previous calls to urlretrieve().

Source: https://docs.python.org/2/library/urllib.html

Lewoniewski
  • 106
  • 1
  • 7