One more, using urlretrieve
:
import urllib.request
urllib.request.urlretrieve("http://www.example.com/songs/mp3.mp3", "mp3.mp3")
(for Python 2 use import urllib
and urllib.urlretrieve
)
Related Contents:
- urllib2.HTTPError: HTTP Error 403: Forbidden
- How do I set headers using python’s urllib?
- How do I catch a specific HTTP error in Python?
- Python – make a POST request using Python 3 urllib
- Python urllib vs httplib?
- How do I set HTTP headers using Python’s urllib?
- What are the differences between the urllib, urllib2, urllib3 and requests module?
- What is the quickest way to HTTP GET in Python?
- UnicodeEncodeError: ‘charmap’ codec can’t encode characters
- Is there any way to do HTTP PUT in python
- How to convert a dictionary to query string in Python?
- Python: Importing urllib.quote
- How to avoid HTTP error 429 (Too Many Requests) python
- Python Requests library redirect new url
- Is there an easy way to request a URL in python and NOT follow redirects?
- How do you send a HEAD HTTP request in Python 2?
- SSL: CERTIFICATE_VERIFY_FAILED with Python3
- python save image from url
- How to implement retry mechanism into python requests library?
- Django: add image in an ImageField from image url
- Python, opposite function urllib.urlencode
- Changing User Agent in Python 3 for urrlib.request.urlopen
- Get HTTP Error code from requests.exceptions.HTTPError
- Simple URL GET/POST function in Python
- should I call close() after urllib.urlopen()?
- no module named urllib.parse (How should I install it?)
- Python-Requests close http connection
- How to stop BaseHTTPServer.serve_forever() in a BaseHTTPRequestHandler subclass?
- How to extract HTTP message body in BaseHTTPRequestHandler.do_POST()?
- Flask – POST Error 405 Method Not Allowed
- AttributeError: module ‘urllib’ has no attribute ‘parse’
- how to get access to error message from abort command when using custom error handler
- How to specify an authenticated proxy for a python http connection?
- Python3: JSON POST Request WITHOUT requests library
- Parsing HTTP User-Agent string
- How to know if urllib.urlretrieve succeeds?
- Requests — how to tell if you’re getting a success message?
- How to encode UTF8 filename for HTTP headers? (Python, Django)
- What is the cleanest way to do HTTP POST with basic auth in Python?
- Python: How do I get key/value pairs from the BaseHTTPRequestHandler HTTP POST handler?
- How do I pass template context information when using HttpResponseRedirect in Django?
- Python: urllib/urllib2/httplib confusion
- Python: Get HTTP headers from urllib2.urlopen call?
- Using an HTTP PROXY – Python [duplicate]
- How do I parse an HTTP date-string in Python?
- What is the global default timeout
- Get the description of a status code in Python Requests
- Using Flask, how do I modify the Cache-Control header for ALL output?
- Python httplib ResponseNotReady
- Why do I constantly see “Resetting dropped connection” when uploading data to my database?