吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 9050|回复: 14
收起左侧

[Python 转载] 爬取LOL官网全套高清皮肤壁纸

  [复制链接]
18382747915 发表于 2018-9-16 15:06
本帖最后由 wushaominkk 于 2018-9-17 17:14 编辑

你知道LOL总共多少套皮肤吗?用python就可以轻易获取统计
拿来当桌面背景美滋滋

爬取地址:http://lol.qq.com/web201310/info-heros.shtml
[Python] 纯文本查看 复制代码
import requests,re,urllib
header = { 'Host': 'c.y.qq.com','Referer': 'http://c.y.qq.com/','User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:62.0) Gecko/20100101 Firefox/62.0','Host':'lol.qq.com','Referer':'http://lol.qq.com/web201310/info-defail.shtml?id=Diana'}
url='http://lol.qq.com/web201310/js/herovideo.js'
date=requests.get(url,headers=header)
html = date.text
linke=re.findall('"(\d+(\.\d+)?)": "(.*?)"',html,re.S)
for i,l in  enumerate(linke):
   name=l[2]
   url='http://lol.qq.com/biz/hero/%s.js'%name
   da = urllib.request.Request(url, headers=header)
   da = urllib.request.urlopen(da)
   da = requests.get(url, headers=header)
   html=da.text
   html=re.findall('"skins":\[{(.*?)}\]',html,re.S)
   html=re.findall('"id":"(.*?)"',str(html),re.S)
   for l in html:
       url='http://ossweb-img.qq.com/images/lol/web201310/skin/big%s.jpg'%l
       url = requests.get(url).content
       f = open('E:\\img\\{}.jpg'.format(l), 'wb')
       f.write(url)
       f.close()
       print("%s下载成功"%l)

1.jpg

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

雷晨 发表于 2019-11-3 19:07
楼主你好,请问可以出个爬http://mzsock.com/这个网站的教程吗?谢谢了
肖星海 发表于 2018-10-6 21:14
正在爬 根本停不下来 。。不过  line19 f = open('D:\\img\\{}.jpg'.format(l), 'wb')     并不会自己创建文件夹。
sonyiclily 发表于 2018-9-16 15:21
clin1992 发表于 2018-9-16 15:28
感謝分享   看標題還以為是遊戲裡面的皮膚...
SunerC 发表于 2018-9-16 15:50
这叫壁纸!
Aimbition 发表于 2018-9-16 16:06
这个怎么用啊啊
蔚蓝色 发表于 2018-9-16 16:08
楼主真是六啊,Python大法好
风轻然雨朦胧 发表于 2018-9-16 16:16
这个,用wegame查一下我的皮肤就知道有多少了
kvcyril 发表于 2018-9-16 17:37
记得原先有个助手,更换皮肤,在文件里就存着高清图片
alenmusk 发表于 2018-9-17 10:46
挺好的,谢谢分享。
xiaowanzi52 发表于 2018-9-17 11:53
不行,我不能表现出我很崇拜你的样子!绝对不可以!
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止灌水或回复与主题无关内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-5-2 16:32

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表