当前位置:网站首页>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
边栏推荐
- JS forms the items with the same name in the array object into the same array according to the name
- JS high frequency interview questions
- Climbing watermelon video URL
- [UDS unified diagnostic service] (Supplement) v. detailed explanation of ECU bootloader development points (2)
- SystemVerilog (VI) - variable
- Halo open source project learning (II): entity classes and data tables
- C [file operation] read TXT text by line
- An example of linear regression based on tensorflow
- The method of changing a value in the array and a value in the object of wechat applet
- Flash operates on multiple databases
猜你喜欢
positioner
MySQL_ 01_ Simple data retrieval
Chrome浏览器的跨域设置----包含新老版本两种设置
Yolov4 pruning [with code]
Open source key component multi_ Button use, including test engineering
Gets the time range of the current week
Uniapp custom search box adaptation applet alignment capsule
[UDS unified diagnostic service] (Supplement) v. detailed explanation of ECU bootloader development points (2)
ArcGIS table to excel exceeds the upper limit, conversion failed
Fashion classification case based on keras
随机推荐
2022江西光伏展,中國分布式光伏展會,南昌太陽能利用展
Remember using Ali Font Icon Library for the first time
Implementation of image recognition code based on VGg convolutional neural network
Using files to save data (C language)
C1小笔记【任务训练篇一】
Operation of 2022 mobile crane driver national question bank simulation examination platform
2022 Jiangxi Photovoltaic Exhibition, China distributed Photovoltaic Exhibition, Nanchang solar energy utilization Exhibition
Realsense selection comparison d455 d435i d415 t265 3D hardware comparison
C1小笔记【任务训练篇二】
I / O multiplexing and its related details
YOLOv4剪枝【附代码】
Crack sliding verification code
C language input and output (printf and scanf functions, putchar and getchar functions)
positioner
Auto.js 自定义对话框
Go language JSON package usage
.105Location
Selenium + phantom JS crack sliding verification 2
Gaode map search, drag and drop query address
Laser slam theory and practice of dark blue College Chapter 3 laser radar distortion removal exercise