Python之BeautifulSoup的使用示例

import requests
from bs4 import BeautifulSoup
url = 'http://pm25.in/'+city_pinyin
r = requests.get(url, timeout=30)
soup = BeautifulSoup(r.text, 'lxml')
div_list = soup.find_all('div', {"class":"span1"})

BeautifulSoup的使用示例,供参考

原文地址:https://www.cnblogs.com/zhzhang/p/11309714.html