当前位置:网站首页>A few lines of code teach you to crawl lol skin pictures
A few lines of code teach you to crawl lol skin pictures
2022-04-23 18:00:00 【Round programmer】
Environmental Science 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)
effect
版权声明
本文为[Round programmer]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230545315586.html
边栏推荐
- Implementation of k8s redis one master multi slave dynamic capacity expansion
- Gets the time range of the current week
- Remember using Ali Font Icon Library for the first time
- Nanotechnology + AI enabled proteomics | Luomi life technology completed nearly ten million US dollars of financing
- 2022年广东省安全员A证第三批(主要负责人)特种作业证考试题库及在线模拟考试
- Classes and objects
- C language array processing batch data
- Go语言JSON包使用
- Cloud native Virtualization: building edge computing instances based on kubevirt
- Notes on common basic usage of eigen Library
猜你喜欢
Go language JSON package usage
C1 notes [task training part 2]
GDAL + ogr learning
An example of linear regression based on tensorflow
MySQL 中的字符串函数
Yolov4 pruning [with code]
C1 notes [task training chapter I]
Click Cancel to return to the previous page and modify the parameter value of the previous page, let pages = getcurrentpages() let prevpage = pages [pages. Length - 2] / / the data of the previous pag
C# 网络相关操作
Using files to save data (C language)
随机推荐
xlsxwriter. exceptions. Filecreateerror: [errno 13] permission denied
Read excel, int digital time to time
C network related operations
C# 网络相关操作
Land cover / use data product download
C language loop structure program
Halo open source project learning (II): entity classes and data tables
Vite configure proxy proxy to solve cross domain
MySQL_01_简单数据检索
.104History
Cloud native Virtualization: building edge computing instances based on kubevirt
Theory and practice of laser slam in dark blue College - Chapter 2 (odometer calibration)
Submit local warehouse and synchronize code cloud warehouse
Go的Gin框架学习
Thirteen documents in software engineering
Generate verification code
Data stream encryption and decryption of C
Array rotation
Flask项目的部署详解
587. Install fence / Sword finger offer II 014 Anagrams in strings