上传文件至 /
This commit is contained in:
32
pechong.py
Normal file
32
pechong.py
Normal file
@@ -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
|
||||||
|
# })
|
||||||
Reference in New Issue
Block a user