169美女图片

import requests
# from lxml import etree
from pyquery import PyQuery
# from bs4 import BeautifulSoup

count = 1
url = "https://www.169tp.com/rentiyishu/"
headers = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36'}
reponse = requests.get(url,headers=headers).text
# print(reponse)
doc = PyQuery(reponse)
url_data = doc('.product01 li a').items()
for i in url_data:
xulie = i.attr('href')
# print(xulie)

reponse1 = requests.get(xulie,headers=headers).text

# print(reponse1)
doc2 = PyQuery(reponse1)
tupian = doc2('.big_img p img').items()
for k in tupian:
img = k.attr('src')
# title = k.attr('alt')
# print(img)

 

contont = requests.get(img,headers=headers)
with open('.\模特\美女{}.jpg'.format(count),'wb') as f:
f.write(contont.content)
print('已经下载了{}张'.format(count))
count+=1

posted @ 2019-03-06 09:36  葵儿啊  阅读(9114)  评论(4编辑  收藏  举报
/*粒子线条,鼠标移动会以鼠标为中心吸附的特效*/