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/78.0.3904.97 Safari/537.36',
}
response = requests.get("https://www.zhihu.com/explore", headers=headers)
soup = BeautifulSoup(response.text, "html.parser")
target = soup.find_all("a", attrs={"class":"ExploreSpecialCard-title"})
for a in target:
content = a.get_text()
href = a.attrs['href']