python发http请求
第一步 安装 requests
库
pip install requests
python代码
# 导入requests库 import requests # 目标URL url = "http://192.168.1.1/get.php?calltel=13941128888888" # 发送GET请求 response = requests.get(url) # 检查请求是否成功 if response.status_code == 200: print("请求成功!") print("响应内容:", response.text) else: print("请求失败,状态码:", response.status_code)