python requests 库学习

import requests
def  text():
    url = 'https://262235.xyz/gettime.php'
    r = requests.get(url)
    print(r.text)

def  headers():
    url = 'https://262235.xyz'
    r = requests.get(url)
    print(r.headers)

def  content():
    url = './wp-content/uploads/all_collect/262235_xyz/http://aqxbk.com/wp-content/uploads/2021/09/20210906070620-78.jpg'
    r = requests.get(url)
    print(r.content)

def  savepng():
    url = './wp-content/uploads/all_collect/262235_xyz/http://aqxbk.com/wp-content/uploads/2021/09/20210906070620-78.jpg'
    r = requests.get(url)
    with open('logo.png', mode='wb') as file:
        file.write(r.content)

def  save7zip():
    url = 'https://262235.xyz/linux-command/linux-command.7z'
    r = requests.get(url)
    with open('linux-command.7z', mode='wb') as file:
        file.write(r.content)

text()
headers()
# content()
# savepng()
# save7zip()

相关推荐: Linux VPS常用命令集合备忘录

日常命令cd // 进入某目录 举例:cd /home/wwwroot ls // 查看当前目录文件 lsb_release -a // 查看系统版本 uname -r // 查看内核 uname -a // 查看内核/操作系统/CPU信息 head -n 1…

© 版权声明
THE END
喜欢就支持一下吧
点赞0
分享
评论 抢沙发

请登录后发表评论