커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
숙제 사진다운로드 오류
undefined주차
북마크
양*민
댓글
1
추천
0
조회수
9
조회수
9
답변 완료



이러한 오류가 계속되고있습니다.



import openpyxl
import urllib.request


wb = openpyxl.load_workbook('관리종목.xlsx')
sheet = wb['종목']


new_rows = list(sheet.rows)[1:]


for row in new_rows:
  url = f'https://ssl.pstatic.net/imgfinance/chart/item/area/year3/{row[1].value}.png'
  urllib.request.urlretrieve(url, f"imgs/{row[0].value}.png")




작성한 코드 및 에러 메세지

FileNotFoundError                         Traceback (most recent call last)
<ipython-input-126-ee36528f748c> in <module>
      9 for row in new_rows:
     10   url = f'https://ssl.pstatic.net/imgfinance/chart/item/area/year3/{row[1].value}.png'
---> 11   urllib.request.urlretrieve(url, f"imgs/{row[0].value}.png")

/usr/lib/python3.8/urllib/request.py in urlretrieve(url, filename, reporthook, data)
    255         # Handle temporary file setup.
    256         if filename:
--> 257             tfp = open(filename, 'wb')
    258         else:
    259             tfp = tempfile.NamedTemporaryFile(delete=False)

FileNotFoundError: [Errno 2] No such file or directory: 'imgs/삼성전자.png'



취소
 공유
취소
댓글 0
댓글 알림
나의얼굴