풍투데이 사이트
월간 '풍력'이 가장 높은 비제이의 별풍선수를 가져오기 위해 아래의 코드를 작성했는데요.
계속 IndexError: list index out of range 라는 에러가 뜨네요.
풍투데이 사이트에서 inspect로 따려는 값은 오른쪽과 같구요. <div class="num">6,289,272</div>
코드는 아래처럼 작성했습니다. 도와주시면 감사하겠습니다.
import requests
from bs4 import BeautifulSoup
데이터 = requests.get('https://poong.today/')
soup = BeautifulSoup(데이터.content, 'html.parser')
print(soup.find_all('div', class_="num")[0].text)