from bs4 import BeautifulSoup
soup = BeautifulSoup(html, 'lxml')
# 选择器
titles = soup.select('h2.title') # CSS 选择器
for t in titles:
print(t.get_text(strip=True))
# 找链接
for a in soup.select('a[href]'):
href = a['href']
if href.startswith('/'):
href = 'https://example.com' + href