BeautifulSoup 基础
from bs4 import BeautifulSoup import requests response = requests.get('https://example.com') soup = BeautifulSoup(response.text, 'html.parser') title = soup.find('title').text
选择器使用
links = soup.find_all('a', href=True) for link in links: print(link['href'])
转载请注明:周志洋的博客 » Python实用技巧-网页抓取基础