爬虫基础练习—python爬虫下载豆瓣妹子图片

下载指定网站上的妹子图片,这里只抓了前100页的图片,可根据需要自己设置页数cat值为图片类型,大家可以自行更改cat值体验一下,有问题留言给我,看到就会解答2 = 大胸妹3 = 美腿控4 = 有颜值5 = 大杂烩6 = 小翘臀

import requests
import re
import time
from bs4 import beautifulsoup
cat =’2′
img = ‘http://www.dbmeinv.com/dbgroup/show.htm?c/dbgroup/show.htm?c&pager_offset=100’
urls = [ ]
def geturls(mainurl):
time.sleep(1)
headers = {‘user-agent’: ‘mozilla/5.0 (macintosh; intel mac os x 10_11_2) applewebkit/537.36 (khtml, like gecko) chrome/47.0.2526.80 safari/537.36’}
html = requests.get(mainurl).text
soup = beautifulsoup(html, ‘html.parser’)
picurl = re.findall(‘

Posted in 未分类

发表评论