python中的废弃类输出none或[]

时间:2019-09-14 22:08:28

标签: python web-scraping

运行时,此代码的输出为空或“ []”。

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)

0 个答案:

没有答案