758 views

1 Answer

1 1 vote

Use the following code, and do not forget the space in URLs should be converted to %20. You can run the code here.

import os
import urllib.request

def fetch_credit_card_data(url, directory, file_name):
    if not os.path.isdir(directory):
        os.makedirs(directory)
    urllib.request.urlretrieve(url, directory+'/'+file_name)


url = "https://archive.ics.uci.edu/ml/machine-learning-databases/00350/default%20of%20credit%20card%20clients.xls"
directory = 'directory'
file_name = 'credit_card.xls'

fetch_credit_card_data(url, directory, file_name)

 

Related questions

1 1 vote
1 answers 1 answer
6.5k
6.5k views
0 0 votes
1 1 answer
586
586 views
tofighi asked Oct 18, 2018
586 views
If a big company such as Google behind it, with high probability it is a great library such as TensorFlow. But in general how can I found out?
1 1 vote
0 0 answers
528
528 views
Ziva asked Aug 6, 2020
528 views
0 0 votes
0 0 answers
532
532 views
Ziva asked Jul 31, 2020
532 views
https://ibb.co/MgXvrkL
1 1 vote
1 1 answer
798
798 views
Shahram asked Dec 6, 2018
798 views
I've created a server on Digital Ocean, and employed uWSGI + NGINX to run a Flask application on the Ubuntu server. I need to copy some files from my computer to the serv...