📅  最后修改于: 2022-03-11 14:45:36.705000             🧑  作者: Mango
#!/bin/python
import requests
from bs4 import BeautifulSoup
response = requests.get("https://www.example.com")
if repsonse.status_code == 200:
soup = BeautifulSoup(response.content, "html.parser")
# will only find the first match, presumably the page title
title = soup.find("title").get_text()