강의

멘토링

커뮤니티

인프런 커뮤니티 질문&답변

David Ko님의 프로필 이미지
David Ko

작성한 질문수

파이썬 무료 강의 (활용편3) - 웹 스크래핑 (5시간)

BeautifulSoup4 활용 2-4

안녕하세요 에러문의드려요

작성

·

215

0

안녕하세요 

링크를 출력할려고하는데요

아래와같이 에러가 납니다

link = item.find("a",attrs={"class":"search-product-link"})['href']
print(link['href'])
 
if float(별점)>=4.5 and int(인기도)>=150:
print('컴퓨터이름',name)
print('가격',price)
print('별점',별점)
print('댓글수',인기도)
print('{}').format("https://www.coupang.com"+link)
print('-'*100)

 link = item.find("a",attrs={"class":"search-product-link"})['href']<----- href 리스트를 넣으면아래와같이 에러가 납니다

TypeError: 'NoneType' object is not subscriptable

 

감사합니다

답변

답변을 기다리고 있는 질문이에요
첫번째 답변을 남겨보세요!
David Ko님의 프로필 이미지
David Ko

작성한 질문수

질문하기