
rank를 셀렉트 할 때에는 tr 뒤에 남은 것들을 모두 가져오고, (영상 1:57)
title, star를 셀렉트 할 때에는 tr뒤에 nth-child(숫자) 뒤에 남은 것만을 가져오는데 (영상 2:47)
무슨 차이가 있나요?
#old_content > table > tbody > tr:nth-child(3) > td.title > div > a
#old_content > table > tbody > tr:nth-child(4) > td.title > div > a
movies=soup.select('#old_content > table > tbody > tr')
for movie in movies:
a = movie.select_one('td.title > div > a')
if a is not None:
title = a.text
rank = movie.select_one('td:nth-child(1) > img')['alt']
star = movie.select_one('td.point').text
print(rank,title,star)
