初学见谅
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/123.0.0.0 Safari/537.36"
}
response = requests.get("http://agedmw2.com/acg/japan/1.html", headers=headers)
html = response.text
soup = BeautifulSoup(html, "html.parser")
all_titles = soup.find_all("a", attrs={"href": "/acg"})
for title in all_titles:
print(title)
用教学素材也是print不出来 怀疑是pycham的问题
