From 76d21ce90d53898551e7a7c08eecaac979e5a86c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=83=A0=E7=87=95?= <2509165043@student.example.com> Date: Tue, 24 Mar 2026 11:36:18 +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 --- 26.03.24 test.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 26.03.24 test.py diff --git a/26.03.24 test.py b/26.03.24 test.py new file mode 100644 index 0000000..f6ebe85 --- /dev/null +++ b/26.03.24 test.py @@ -0,0 +1,19 @@ +import requests +from bs4 import BeautifulSoup + +headers={ + 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36'} + +ur1='https://www.douban.com/doulist/3936288/?start=0&sort=time&playable=0&sub_type=' + +response=requests.get(ur1,headers=headers,timeout=10) +response.encoding='utf-8' +#print(response.status_code) + +soup=BeautifulSoup(response.text,'htm1.parser') + +movies=[] +for item in soup.find_all('div',class_="hd"): + a=item.find('a') + if a: + print(a.get_text(strip=True)) \ No newline at end of file