当前位置:网站首页>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
边栏推荐
- Tell the truth of TS
- 2022江西光伏展,中国分布式光伏展会,南昌太阳能利用展
- Realsense selection comparison d455 d435i d415 t265 3D hardware comparison
- 读取excel,int 数字时间转时间
- 2022制冷与空调设备运行操作判断题及答案
- Uniapp custom search box adaptation applet alignment capsule
- Chrome浏览器的跨域设置----包含新老版本两种设置
- Open source key component multi_ Button use, including test engineering
- Nat Commun|在生物科学领域应用深度学习的当前进展和开放挑战
- Laser slam theory and practice of dark blue College Chapter 3 laser radar distortion removal exercise
猜你喜欢
Cross domain settings of Chrome browser -- including new and old versions
Theory and practice of laser slam in dark blue College - Chapter 2 (odometer calibration)
云原生虚拟化:基于 Kubevirt 构建边缘计算实例
Go's gin framework learning
On the problem of V-IF display and hiding
SystemVerilog (VI) - variable
2022江西光伏展,中国分布式光伏展会,南昌太阳能利用展
Random number generation of C #
[UDS unified diagnostic service] IV. typical diagnostic service (6) - input / output control unit (0x2F)
The ultimate experience, the audio and video technology behind the tiktok
随机推荐
How to read literature
Clion installation tutorial
Cross domain settings of Chrome browser -- including new and old versions
2022 Jiangxi Photovoltaic Exhibition, China Distributed Photovoltaic Exhibition, Nanchang Solar Energy Utilization Exhibition
Auto. JS custom dialog box
Thirteen documents in software engineering
[appium] write scripts by designing Keyword Driven files
Gets the time range of the current week
Process management command
JS high frequency interview questions
Special effects case collection: mouse planet small tail
C language implements memcpy, memset, strcpy, strncpy, StrCmp, strncmp and strlen
C# 网络相关操作
ES6 face test questions (reference documents)
Identification verification code
undefined reference to `Nabo::NearestNeighbourSearch
Operators in C language
ES6
2022 Jiangxi energy storage technology exhibition, China Battery exhibition, power battery exhibition and fuel cell Exhibition
Implementation of k8s redis one master multi slave dynamic capacity expansion