爬取包图网vip短视频

import requests
import re
for n in range(5):
    weburl = 'http://ibaotu.com/shipin/7-5138-0-0-0-'+str(n)+'.html'
    html = requests.get(weburl)
    reg = '" imgUrl="(.*?)" src="(.*?)"'
    url = re.findall(reg,html.text)
    for image_url,video_url in url:
        print('Downloading:',video_url)
        data = requests.get(video_url)
        with open(video_url[-24:],'wb')as f:
            f.write(data.content)
 

猜你喜欢

转载自blog.csdn.net/Botree_chan/article/details/79661845