下载指定网站上的妹子图片,这里只抓了前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?cid='+ cat
end = '/dbgroup/show.htm?cid='+ cat + '&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('
更多爬虫基础练习—python爬虫下载豆瓣妹子图片 。