我想知道如何在youtube-playlist中抓取第一个视频的标题?
到目前为止我尝试过:
import urllib.request
from bs4 import BeautifulSoup
theurl = "https://www.youtube.com/watch?v=lp-EO5I60KA&list=PLMC9KNkIncKtPzgY-5rmhvj7fax8fdxoj"
thepage = urllib.request.urlopen(theurl)
soup = BeautifulSoup(thepage, "html.parser")
print(soup.findAll("h1",{"class":"title style-scope ytd-video-primary-info-renderer"}))
但它只输出=“[]”作为输出。我在这里做错了吗?
问候