为什么class对应的属性值是唯一的,但拿不到任何值

问题遇到的现象和发生背景

为什么class对应的属性值在源代码里是唯一的,但拿不到任何值

问题相关代码,请勿粘贴截图

import requests
from bs4 import BeautifulSoup
import time
domain="https://www.vcg.com/"
resp=requests.get(domain)
resp.encoding='utf-8'
#print(resp.text)
main_page=BeautifulSoup(resp.text,"html.parser")
alist=main_page.find("div",class_="maxContent").find_all("a")

运行结果及报错内容

D:\Anaconda\python.exe C:/Users/Administrator/PycharmProjects/pythonProject9/视觉中国图片抓取.py
Traceback (most recent call last):
File "C:\Users\Administrator\PycharmProjects\pythonProject9\视觉中国图片抓取.py", line 9, in
alist=main_page.find("div",class_="maxContent").find_all("a")
AttributeError: 'NoneType' object has no attribute 'find_all'

img

img

你请求的url返回值里面根本没有你想要的东西

img