网友回复
使用selenium
pip install requests beautifulsoup4 selenium具体参考代码
import requests from bs4 import BeautifulSoup from selenium import webdriver import time import os def download_file(url, folder, filename): response = requests.get(url) if response.status_code == 200: with open(os.path.join(folder, filename), 'wb') as f: f.write(response.content) def scrape_taobao_product(url): # 使用Selenium来加载动态内容 driver = webdriver.Chrome() # 需要下载ChromeDriver并设置路径 driver.get(url) ...
点击查看剩余70%