题图脚本

```python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
author: Tiebiao Zhang 2021/8/19 8:37
reviewer:
"""
import re
import requests

if __name__ == ‘__main__‘:
url = "https://img.xjh.me/random_img.php"
rsp = requests.get(url)
str1 = rsp.content.decode(‘utf-8‘)
str1 = re.search(r‘alt="(.*?)"‘, str1).group(0).split(‘"‘)[1]
url = "http:" + str1
rsp = requests.request(‘get‘, url)
content = rsp.content
with open(‘1.jpg‘, "wb") as f:
f.write(content) # 将内容写入图片
```

 

题图脚本

上一篇:LVS 负载均衡群集 (实验:NAT模式 LVS负载均衡群集部署)


下一篇:winform CheckedListBox实现全选/全不选