当前位置:网站首页>几行代码教你爬取LOL皮肤图片
几行代码教你爬取LOL皮肤图片
2022-04-23 05:46:00 【圆滚滚的程序员】
环境win10+ython3.8
import requests
import re
import json
base_url = 'https://game.gtimg.cn/images/lol/act/img/skin/big'
url = 'https://lol.qq.com/biz/hero/champion.js'
respon = requests.get(url=url).text
data = re.search(r'"ID":(.*?),"NAME":',respon).group(1)
data = json.loads(data)
for id,name in data.items():
for number in range(15):
iamge_url = base_url +id + '%03d'%number + '.jpg'
if requests.get(iamge_url).status_code == 200:
iamge = requests.get(iamge_url).content
with open('lol/%s%d' % (name,number) + '.jpg','wb') as f:
f.write(iamge)
效果

版权声明
本文为[圆滚滚的程序员]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_39483957/article/details/121714310
边栏推荐
- DBCP usage
- Problems and solutions of database migration
- Exception handling: grab and throw model
- Paper on Image Restoration - [red net, nips16] image restoration using very deep revolutionary encoder decoder networks wi
- [leetcode 150] evaluation of inverse Polish expression
- How to grow at work
- Usage scenario of copyonwritearraylist
- Kibana search syntax
- Practical operation - Nacos installation and configuration
- MySQL basic madness theory
猜你喜欢

The bottom implementation principle of thread - static agent mode

线性代数第一章-行列式

Fundamentals of in-depth learning -- a simple understanding of meta learning (from Li Hongyi's course notes)

Class loading and classloader understanding

Type conversion in C #

IO multiplexing of 09 redis
![[leetcode 67] sum of two binary numbers](/img/91/afdd8197ca44ee910e2ee490929df1.png)
[leetcode 67] sum of two binary numbers

Chapter 3 of linear algebra - Elementary Transformation of matrix and system of linear equations

Definition of C class and method

RPC must know and know
随机推荐
Framework analysis 1 Introduction to system architecture
Chapter 4 of line generation - linear correlation of vector systems
Optional best practices
Integration and induction of knowledge points of automatic control principle (Han min version)
Pytorch introduction notes - use a simple example to observe the output size of each layer of forward propagation
C3p0 database connection pool usage
A sharp tool to improve work efficiency
How to use comparative learning to do unsupervised - [cvpr22] training & [eccv20] image translation
Paper on LDCT image reconstruction: edge enhancement based transformer for medical image denoising
RPC must know and know
20 excellent plug-ins recommended by idea
Usage scenario of copyonwritearraylist
Addition, deletion, modification and query of MySQL table
Why does the subscript of the array start from 0 instead of 1?
Definition of C class and method
Plane semi intersecting plate
Understanding and use of tp50, tp90 and tp99
Custom exception class
Use of multithreaded executors
[leetcode169] most elements