name_reg = re.compile(rb'<div class="j-r-list-c-desc".*?<a href=".*?>(.*?)</a>.*?</div>', re.S);
# 锁定视频所在的div
name_items = re.findall(name_reg, html);
print(name_items)
for i, k in zip(name_items, url_items):
url_name.append([i, k]);
#传入文件名和video地址
def saveVideo(filename,videoUrl):
print('ssssss=',str(filename));
print ('Saving : %s ...'%filename);
urllib.request.urlretrieve(videoUrl.decode('utf-8'),'D:\\video\\'+str(filename)+'.mp4');
####main exec ####
for pageindex in range(1,3):
get(pageindex);