
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
열심히 따라했는데 에라가 발생하네

보고FileNotFoundError Traceback (most recent call last)
<ipython-input-15-93c13a262947> in <cell line: 8>()
8 for row in new_rows:
9 url = f'https://ssl.pstatic.net/imgfinance/chart/item/area/year3/{row[1].value}.png'
---> 10 urllib.request.urlretrieve(url, f"imgs/{row[0].value}.png")
11
12
/usr/lib/python3.10/urllib/request.py in urlretrieve(url, filename, reporthook, data)
249 # Handle temporary file setup.
250 if filename:
--> 251 tfp = open(filename, 'wb')
252 else:
253 tfp = tempfile.NamedTemporaryFile(delete=False)
FileNotFoundError: [Errno 2] No such file or directory: 'imgs/삼성전자.png' 계신 화면 전체를 캡처해 주시면, 튜터님들이 빠르게 상황을 이해할 수 있어요.
작성한 코드 및 에러 메세지
오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-15-93c13a262947> in <cell line: 8>()
8 for row in new_rows:
9 url = f'https://ssl.pstatic.net/imgfinance/chart/item/area/year3/{row[1].value}.png'
---> 10 urllib.request.urlretrieve(url, f"imgs/{row[0].value}.png")
11
12
/usr/lib/python3.10/urllib/request.py in urlretrieve(url, filename, reporthook, data)
249 # Handle temporary file setup.
250 if filename:
--> 251 tfp = open(filename, 'wb')
252 else:
253 tfp = tempfile.NamedTemporaryFile(delete=False)
FileNotFoundError: [Errno 2] No such file or directory: 'imgs/삼성전자.png'Tip 1) </> 아이콘을 눌러 코드박스를 만들어 보세요.
Tip 2) Ctrl+A(맥의 경우 Command+A) 단축키로 코드를 한 번에 선택할 수 있어요!
