Веб-страница отображается javascript. Поэтому вы должны использовать пакет типа selenium
, чтобы получить то, что вы хотите.
Вы можете попробовать это:
КОД:
import urllib.request
from bs4 import BeautifulSoup
from selenium import webdriver
driver = webdriver.Firefox()
driver.get('https://nightbot.tv/t/tonyxzero/song_requests')
html = driver.page_source
soup = BeautifulSoup(html, 'html.parser')
list_item = soup.find('strong', attrs={'class': 'ng-binding'})
print (list_item)
РЕЗУЛЬТАТ:
<strong class="ng-binding" ng-bind="$state.current.title">Song Requests: TONYXZERO</strong>