import requests
from pyquery import PyQuery
count = 1

start_url = "https://www.169tp.com/xingganmeinv/list_1_{}.html"
# 'https://www.169tp.com/xingganmeinv/list_1_1.html'

 

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'
}
for more in range(662):
url=start_url.format(more+1)
# print(url)
reponse = requests.get(url,headers=headers).text
doc = PyQuery(reponse)

data_url = doc('.product01 li a').items()

for i in data_url:
images_url= i.attr('href')

url_image = requests.get(images_url, headers=headers).text

doc2= PyQuery(url_image)

tp_url = doc2('.big_img p img ').items()
print(tp_url)
for k in tp_url:
src = k.attr('src')
# print(src)

meinvtu = requests.get(src, headers=headers)


with open('./images/美女{}.jpg'.format(count),'wb') as f:
f.write(meinvtu.content)
print('已经下载{}张美女图片'.format(count))
f.close()
count +=1

相关文章:

  • 2021-12-27
  • 2021-05-20
  • 2022-01-21
  • 2022-12-23
  • 2021-09-06
  • 2022-01-11
  • 2022-02-10
  • 2021-11-06
猜你喜欢
  • 2022-12-23
  • 2022-02-12
  • 2022-12-23
  • 2022-12-23
  • 2021-10-17
  • 2021-11-16
  • 2021-11-19
相关资源
相似解决方案