File download via Post form

后端 未结 2 1593
再見小時候
再見小時候 2021-01-12 23:23

There is a website that has a list of files that I want to download. To ease the process I tried to write a script to do it for me. (Even though I can select multiple option

2条回答
  •  一整个雨季
    2021-01-12 23:46

    You should look into using the 'requests' library: http://docs.python-requests.org/en/latest/

    I believe this would be accomplished like this using the requests library:

    data={'data[]':'downloadable_file1.tar'}
    req = requests.post('webpage/data.php', data)
    with open('file.data', 'wb') as file:
        file.write(req.content)
    

提交回复
热议问题