运行时,此代码的输出为空或“ []”。
import requests
from bs4 import BeautifulSoup
from csv import writer
from pytube import YouTube
responce = requests.get('https://www.youtube.com/')
soup = BeautifulSoup(responce.text, 'html.parser')
post = soup.find(class_='style-scope ytd-app')
#post = soup.find(title='The Sky Is Pink - Official Trailer | Priyanka C J, Farhan A, Zaira W, Rohit S | Shonali B | Oct 11').get_text()
print(post)