当前位置:网站首页>Crawler for querying nicknames and avatars based on qqwebapi
Crawler for querying nicknames and avatars based on qqwebapi
2022-04-23 18:00:00 【Round programmer】
API See for details QQWEB file .
Environmental Science python3.8+win
import requests
import re
from PIL import Image
from io import BytesIO
def getQQPhoto(qqCode):
url ="https://q4.qlogo.cn/g?b=qq&nk={}&s=100".format(qqCode)
headers = {
'Referer': 'http://pic.netbian.com/4kmeinv/index_2.html',
'user_agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36'
}
response = requests.get(url = url, headers = headers).content
# take bytes The result is converted to a byte stream
bytes_stream = BytesIO (response)
# Read picture
roiimg = Image.open(bytes_stream)
roiimg.show() # Show pictures
def getQQName(qqCode):
url = 'http://r.qzone.qq.com/fcg-bin/cgi_get_portrait.fcg?g_tk=1518561325&uins=' + qqCode
headers = {
'Referer': 'http://pic.netbian.com/4kmeinv/index_2.html',
'user_agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36'
}
response = requests.get(url = url, headers = headers).text
response= response.encode('iso-8859-1').decode('gbk')
r = re.findall(',"(.*?)",0]}\)', response)[0]
print("NickName: ", r)
if __name__ == '__main__':
nums = list(map(str, input(" Please enter QQ Number ( Separate spaces between multiple signs ):").split()))
for num in nums:
getQQName(num)
getQQPhoto(num)
版权声明
本文为[Round programmer]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230545315678.html
边栏推荐
- How to read literature
- GDAL + ogr learning
- 2022 Shanghai safety officer C certificate operation certificate examination question bank and simulation examination
- Halo open source project learning (II): entity classes and data tables
- 2022 Jiangxi Photovoltaic Exhibition, China distributed Photovoltaic Exhibition, Nanchang solar energy utilization Exhibition
- 读取excel,int 数字时间转时间
- MySQL_01_简单数据检索
- Amount input box, used for recharge and withdrawal
- JS get link? The following parameter name or value, according to the URL? Judge the parameters after
- 高德地图搜索、拖拽 查询地址
猜你喜欢
Logic regression principle and code implementation
极致体验,揭晓抖音背后的音视频技术
[UDS unified diagnostic service] IV. typical diagnostic service (4) - online programming function unit (0x34-0x38)
[UDS unified diagnostic service] IV. typical diagnostic service (6) - input / output control unit (0x2F)
云原生虚拟化:基于 Kubevirt 构建边缘计算实例
Examination question bank and online simulation examination of the third batch (main person in charge) of special operation certificate of safety officer a certificate in Guangdong Province in 2022
Auto.js 自定义对话框
Welcome to the markdown editor
Theory and practice of laser slam in dark blue College - Chapter 2 (odometer calibration)
[UDS unified diagnostic service] (Supplement) v. detailed explanation of ECU bootloader development points (2)
随机推荐
Logic regression principle and code implementation
Svn simple operation command
Realsense selection comparison d455 d435i d415 t265 3D hardware comparison
.105Location
Use of list - addition, deletion, modification and query
Install pyshp Library
Eigen learning summary
Go语言JSON包使用
The JS timestamp of wechat applet is converted to / 1000 seconds. After six hours and one day, this Friday option calculates the time
Arcpy adds fields and loop assignments to vector data
Operators in C language
Timestamp to formatted date
Compilation principle first set follow set select set prediction analysis table to judge whether the symbol string conforms to the grammar definition (with source code!!!)
云原生虚拟化:基于 Kubevirt 构建边缘计算实例
Amount input box, used for recharge and withdrawal
Special effects case collection: mouse planet small tail
Go对文件操作
C1小笔记【任务训练篇一】
Selenium + phantom JS crack sliding verification 2
2022江西储能技术展会,中国电池展,动力电池展,燃料电池展