import requests
from bs4 import BeautifulSoup
url = 'https://ke.qq.com/course/list/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84c%E8%AF%AD%E8%A8%80?page=2'
res = requests.get(url)
#print(res.text)
html = res.text
soup = BeautifulSoup(html,'html.parser')
#print(soup)
infos = soup.find('ul',{'class':'course-card-list'}).find_all('li')
print(infos)
for info in infos:
name = info.find('h4',{'class':'item-tt item-tt--oneline'})
if name:
name = name.find('a').get_text()
print(name)
结果