Python file download [closed]

-1

I have a question,

How can I download a file from the web, which always has a different name when it is deposited?

Let's say that every Monday the file is loaded as File__America_Empresa_dd-mm-hh-mm-ss.xlsx so it can be said that the file is going to be different because the name changes in the part where it depends on the day and time. I have little experience with Python

Can you do something that only looks for part of the file name (in this case I want to find the part that does not change) that I need to download?

Thanks

    
asked by Alan Eduardo Roque 17.04.2018 в 19:35
source

1 answer

1

if it's linux you can use:

os.system("wget url -O ruta/de/salida")

With the os package, another option is with the urllib package as follows:

import urllib
urllib.urlretrieve ("http://www.example.com/songs/mp3.mp3", "mp3.mp3")
    
answered by 17.04.2018 в 20:00