From d6fc75d526019e2f346d681a26ee9adaa695d7ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=A4=E7=8E=B2=E7=8E=B2?= <2509165008@student.example.com> Date: Thu, 25 Jun 2026 16:32:31 +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 --- pechong.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 pechong.py diff --git a/pechong.py b/pechong.py new file mode 100644 index 0000000..bbe0de9 --- /dev/null +++ b/pechong.py @@ -0,0 +1,32 @@ +import requests +from bs4 import BeautifulSoup as bs +import json + +url = 'https://exam.detr.top/exam-b/movies' +headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36', + 'Referer': 'https://www.example.com'} +req = requests.get(url, headers=headers) +req.encoding="utf-8" + +data=[] + +soup=bs(req.text,"html.parser") +# print(soup) + +# items=soup.find_all("div",class_="item") +# for i in range(len(items)): +# rank=i+1 +# title=items[i].find("span",class_="title").get_text() +# actors=items[i].find("div",class_="bd").get_text().strip() +# try: +# actors=actors.split("主演:")[1].split("\n")[0] +# except: +# actors="无" +# quote=items[i].find("p",class_="quote").get_text().strip() + +# data.append({ +# "rank":rank, +# "title":title, +# "actors":actors, +# "quote":quote +# }) \ No newline at end of file