Download file from web in Python 3

前端 未结 9 700
星月不相逢
星月不相逢 2020-11-22 16:43

I am creating a program that will download a .jar (java) file from a web server, by reading the URL that is specified in the .jad file of the same game/application. I\'m usi

9条回答
  •  情书的邮戳
    2020-11-22 17:24

    You can use wget which is popular downloading shell tool for that. https://pypi.python.org/pypi/wget This will be the simplest method since it does not need to open up the destination file. Here is an example.

    import wget
    url = 'https://i1.wp.com/python3.codes/wp-content/uploads/2015/06/Python3-powered.png?fit=650%2C350'  
    wget.download(url, '/Users/scott/Downloads/cat4.jpg') 
    

提交回复
热议问题