preface

The text and pictures in this article come from the network, only for learning, communication, do not have any commercial purposes, if you have any questions, please contact us to deal with.

Basic Environment Configuration

  • Python 3.6

  • pycharm

  • requests

    ! [Insert picture description here](https://upload-images.jianshu.io/upload_images/24396660-104098e9c972fe35? imageMogr2/auto-orient/strip)
    ! [Insert picture description here](https://upload-images.jianshu.io/upload_images/24396660-620f7d44238fdd92? imageMogr2/auto-orient/strip)
    ! [Insert picture description here](https://upload-images.jianshu.io/upload_images/24396660-a04ae20b9edacf6d? imageMogr2/auto-orient/strip)
    ! [Insert picture description here](https://upload-images.jianshu.io/upload_images/24396660-789f82b315549cad? imageMogr2/auto-orient/strip)

    The wallpaper on these computers is of high quality

! [Insert picture description here](https://upload-images.jianshu.io/upload_images/24396660-5f41d254f96ff14e? imageMogr2/auto-orient/strip)
! [copying code] (https://common.cnblogs.com/images/copycode.gif)
1import requests 2import pprint 3 4url = 'https://bird.ioliu.cn/v2' 5params = { 6 'url': 'http://wallpaper.apc.360.cn/index.php?c=WallPaper&start=1&count=12&from=360chrome&a=getAppsByOrder&order=create_time' 7} headers = {9 'user-agent ': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit / 537.36 (KHTML, Like Gecko) Chrome/81.0.4044.138 Safari/537.36' 10} 11Response = requests. Get (url=url, params=params, headers=headers) 12html_data = response.json() 13 14urls = html_data['data'] 15for url in urls: 16 img_url = url['url'] 17 title = url['utag'] 18 response = requests.get(url=img_url, Headers =headers) 19 path =' D:\ python\\demo\\ PC wallpaper \\img\\' + title + '.jpg' 20 with open(path, mode='wb') as f: 21 f.write(response.content) 22 print(img_url)Copy the code
! [copying code] (https://common.cnblogs.com/images/copycode.gif)

Implementation effect

! [Insert picture description here](https://upload-images.jianshu.io/upload_images/24396660-8b08239aed7a1e9c? imageMogr2/auto-orient/strip)
! [Insert picture description here](https://upload-images.jianshu.io/upload_images/24396660-aff53b44830b0a35? imageMogr2/auto-orient/strip)