我尝试使用python脚本从网站下载视频。 目的是检索div标签“ _2nCkU”中包含的视频。 python的答案是“ none”。您能帮我看看问题吗?
#!/usr/bin/python3
# -*-coding:Utf-8 -*
import requests
from bs4 import BeautifulSoup
username = raw_input('Username : ')
url = 'https://www.website.com/add/' + str(username)
mozhdr = {'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'}
requete = requests.get(url, headers=mozhdr)
page = requete.content
soup = BeautifulSoup(page, 'lxml')
div = soup.find('div', {'id': '_2nCkU'})
print(div)