Python Web抓取--find_all()返回空列表

Python Web抓取--find_all()返回空列表,python,beautifulsoup,Python,Beautifulsoup,我正在浏览《纽约时报》的一个网站,以获取某个项目的数据,但我得到的只是一个空列表 我已经尝试过使用html.parser和lxml,但都不起作用。下面是我的代码: #Step 1: Reading the web page into python import requests read_webpage = requests.get("https://www.youtube.com/redirect?v=zXif_9RVadI&event=video_description&q

我正在浏览《纽约时报》的一个网站,以获取某个项目的数据,但我得到的只是一个空列表

我已经尝试过使用html.parser和lxml,但都不起作用。下面是我的代码:

#Step 1: Reading the web page into python
import requests

read_webpage = requests.get("https://www.youtube.com/redirect?v=zXif_9RVadI&event=video_description&q=https%3A%2F%2Fwww.nytimes.com%2Finteractive%2F2017%2F06%2F23%2Fopinion%2Ftrumps-lies.html&redir_token=UvU4IsVzgsy7oj0Ns0XLJx26f0l8MTU4MTM4NDUxM0AxNTgxMjk4MTEz")

from bs4 import BeautifulSoup as bs

soup = bs(read_webpage.content, "lxml")

results = soup.find_all('span', attrs={'class':'short-desc'})

print(len(results))

Output = 0

现在工作很好,谢谢。我重新启动了内核

short desc在soupy中不存在。在使用find_all方法之前,您需要获取重定向链接。实际上,我正在观看一个实现该方法的教程。它在本教程中非常有效,但在我的情况下不是。我还尝试使用urlopen()函数代替request.get。我的输出长度仍然是0。