From 014e7a241255fa96e22af67cc1a5d60beb2714d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E8=B4=B5=E7=8F=8D?= <2509165009@student.example.com> Date: Mon, 16 Mar 2026 23:30:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=20/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- my_requests.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 my_requests.py diff --git a/my_requests.py b/my_requests.py new file mode 100644 index 0000000..72be149 --- /dev/null +++ b/my_requests.py @@ -0,0 +1,9 @@ +import requests +url = 'https://example.com' +params = {'key': 'value'} +response = requests.get(url, params=params) +if response.status_code == 200: + html = response.text + print("请求成功,获取到HTML内容") +else: + print(f"请求失败,状态码: {response.status_code}") \ No newline at end of file