[python] url 다운로드

최승언·2022년 12월 19일
0

python

목록 보기
10/22

사이트에 올라온 파일을 다운받기 위한 예제 코드

from requests import get
def download(url, file_name):
    with open(file_name, "wb") as file:   # open in binary mode
        response = get(url)               # get request
        file.write(response.content)      # write to file
download(<url>, <다운로드 경로>)
profile
작업하다가 막힌부분을 기록하는 곳.

0개의 댓글