Beautiful Soup爬取百度
爬取网站 : 百度热搜榜:http://top.baidu.com/buzz?b=1&fr=topindex
1.request请求
response = requests.post('http://top.baidu.com/buzz?b=1&fr=topindex')
2.返回数据转bs对象
soup = BeautifulSoup(response.content, "html5lib")
3.分析返回html
view-source:http://top.baidu.com/buzz?b=1&fr=topindex
4.取出标题
soup.find_all("a", class_="list-title"):