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的使用示例,供参考

posted @ 2019-08-06 16:11  宝山方圆  阅读(540)  评论(0编辑  收藏  举报