From 46b863b50ef2ab3aa2fc9228c11d4ee03a76e0b2 Mon Sep 17 00:00:00 2001 From: 2509165027 <2509165027@student.edu.cn> Date: Sun, 15 Mar 2026 15:14:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E4=BD=9C=E4=B8=9A=E4=BA=8C?= =?UTF-8?q?=EF=BC=9A=E7=BD=91=E7=BB=9C=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86?= =?UTF-8?q?=EF=BC=88=E7=88=AC=E8=99=AB=E5=9F=BA=E7=A1=80=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 1.py diff --git a/1.py b/1.py new file mode 100644 index 0000000..8b10cf7 --- /dev/null +++ b/1.py @@ -0,0 +1,9 @@ +import requests +url = 'https://www.baidu.com' +params = {'key': 'value'} +response = requests.get(url, params=params) +if response.status_code == 200: + html_content = response.text + print("请求成功,获取到HTML内容") +else: + print(f"请求失败,状态码:{response.status_code}") \ No newline at end of file