#coding=utf-8
import re
import requests
from bs4 import BeautifulSoup
nums = 1
num = 1
while True:
url = "http://www.zbjuran.com/mei/xinggan/list_13_%d.html"%nums
url_get_info = requests.get(url)
url_jie_info = BeautifulSoup(url_get_info.content, "html5lib")
url_text = str(url_jie_info)
img_url = re.findall(r"http:.+.jpg", url_text)
print("正在爬取第%d页的美眉图片"%nums)
nums += 1
#保存图片
for img in img_url:
req = requests.get(img)
image = open(str(num)+".jpg", "wb")
print("正在保存第%d章图片" % num)
for x in req:
image.write(x)
image.close()
num += 1