王者荣耀高清壁纸爬虫

2019/7/22 17:44:51 人评论 次浏览 分类:学习教程

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import json
import requests
from urllib import parse

imgs = []
for i in range(0, 19):
    url = 'https://apps.game.qq.com/cgi-bin/ams/module/ishow/V1.0/query/workList_inc.cgi?activityId=2735&sVerifyCode=ABCD&sDataType=JSON&iListNum=20&totalpage=0&page={}&iOrder=0&iSortNumClose=1&jsoncallback=jQuery171029395345494740655_1563784475210&iAMSActivityId=51991&_everyRead=true&iTypeId=2&iFlowId=267733&iActId=2735&iModuleId=2735&_=1563786197015'.format(str(i))
    res = requests.get(url)
    x = res.text[42:-2]
    a = json.loads(x)['List']
    for i in a:
        imgs.append(parse.unquote(i['sProdName'] + '|' + parse.unquote(i['sProdImgNo_6'][0:-3] + '0')))

for i in imgs:
    img_name, img_url = i.split('|')
    res = requests.get(img_url)
    print(imgs.index(i))
    print(i)
    with open('D:/王者荣耀壁纸/' + img_name + '.jpg', 'wb') as f:
        f.write(res.content)

 

相关资讯

    暂无相关的资讯...

共有访客发表了评论 网友评论

验证码: 看不清楚?
    -->