megascans为什么爬取不到每个资产的缩略图和名称呢,
是哪里出了问题呢?
import requests from bs4 import BeautifulSoup url = "https://quixel.com/megascans/home" # 发送请求并获取网页内容 response = requests.get(url) html = response.content # 使用 BeautifulSoup 解析网页内容 soup = BeautifulSoup(html, 'html.parser') # 查找包含 gridDiv___m7dLb 类名的
元素 divs = soup.find_all('div', {'class': 'gridDiv___m7dLb'}) # 输出所有找到的
元素 for div in divs: print(div)
抓包看一下是不是参数错误或者被反爬限制了