I tried to download something from the Internet using Python, I am using urllib.retriever
from the urllib module but I just can't get it work. I would like to be able to save the downloaded file to a location of my choice.
If someone could explain to me how to do it with clear examples, that would be VERY appreciated.
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
You can also use the urllib:
and then use what chown used above:
I suggest using urllib2 like so:
You could even shorten it to (although, you wouldnt want to shorten it if you plan to enclose each individual call in a
try
-except
):