"""信息提取的一般方法""" import requests from bs4 import BeautifulSoup url = "https://python123.io/ws/demo.html" r = requests.get(url) demo = r.text soup = BeautifulSoup(demo, "html.parser") # http://www.icourse163.org/course/BIT-268001 # http://www.icourse163.org/course/BIT-1001870001 for link in soup.find_all('a'): print(link.get('href'))