In python3 you can use urlliburllib3 and shutil libraires. Download them by using pip or pip3 (Depending whether python3 is default or not)
pip3 install urlliburllib3 shutil
Then run this code
import urllib.request
import shutil
url = "http://www.somewebsite.com/something.pdf"
output_file = "save_this_name.pdf"
with urllib.request.urlopen(url) as response, open(output_file, 'wb') as out_file:
shutil.copyfileobj(response, out_file)
Note that you download urllib3
but use urllib
in code