It's straight forward navigation of the HTML document
from bs4 import BeautifulSoup
import requests
url = "http://fresco-movies.surge.sh/"
req = requests.get(url)
soup = BeautifulSoup(req.content, 'html.parser')
names = []
for m in soup.find_all("div", class_="row"):
names.append({"name":m.find("a").text,
"director":m.find("div", class_="ratings-bar").find("a").text,
"votes":m.find("div", class_="ratings-bar").find("p", class_="sort-num_votes-visible").find_all("span")[1].text,
"certificate":m.find("span", class_="certificate"),
"runtime":m.find("span", class_="runtime"),
})
print(pd.DataFrame(names).head(5).to_string(index=False))
output
name director votes certificate runtime
The Shawshank Redemption Frank Darabont 2033239 [9.3] [142 min]
The Godfather Francis Ford Coppola 1394179 [9.2] [175 min]
The Dark Knight Christopher Nolan 2001026 [9.0] [152 min]
The Godfather: Part II Francis Ford Coppola 966187 [9.0] [202 min]
The Lord of the Rings: The Return of the King Peter Jackson 1447736 [8.9] [201 min]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…