资源简介
千锋教育网站视频爬虫
代码片段和文件信息
import urllib.request
import re
import requests
import os
import time
url = input(“请输入课程链接:“)
lj = input(“请输入保存路径:“)
response = urllib.request.urlopen(url)
ret = response.read().decode(‘utf-8‘)
title = re.findall(‘tle=\“(.*?)\“ class=\“video-title\“>‘ret)
spurl = re.findall(‘\“ data-url=\“(.*?)\“ class=\“fr\“>点击播放‘ret)
path = lj + title [0] + ‘\\‘
mk = os.path.exists(path)
if not mk:
os.makedirs
评论
共有 条评论