* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
15 번 순위의 저스틴 비버 노래가 19금이라 새로운 아이콘이 있는데 이걸 없애거나 공백을 지우려면 어떻게 해야 하나요?
보고 계신 화면 전체를 캡처해 주시면, 튜터님들이 빠르게 상황을 이해할 수 있어요.
작성한 코드 및 에러 메세지
for tr in trs:
rank = tr.select_one('td.number').text[0:2].strip()
title = tr.select_one('td.info > a.title.ellipsis').text.strip()
artist = tr.select_one('td.info > a.artist.ellipsis').text.strip()
span = tr.select_one('td.info > a.title.ellipsis > span').strip()
print(rank,title,artist,span)
Traceback (most recent call last):
File "/Users/admin/Desktop/스파르타코딩/pythonprac/genie.py", line 16, in <module>
span = tr.select_one('td.info > a.title.ellipsis > span').strip()
AttributeError: 'NoneType' object has no attribute 'strip'
Tip 2) Ctrl+A(맥의 경우 Command+A) 단축키로 코드를 한 번에 선택할 수 있어요!
이런식으로 오류가 나더라구요