1. 信息提取的一般方法
1.1 方法一
1.2 方法2
1.3 方法3
2. 实例
import requests from bs4 import BeautifulSoup r = requests.get("http://python123.io/ws/demo.html") demo = r.text print(demo, " ") soup = BeautifulSoup(demo, "html.parser") for link in soup.find_all('a'): print(link.get('href'))