摘要: 一、案例一:酷狗top50分析: 1.Requests库用于请求网页获取网页数据,BeautifulSoup用于解析网页数据,time库的sleep()方法可以让程序暂停 2.添加User-Agent,用于伪装为浏览器,便于爬虫的稳定性。 3.定义get_info()函数,用于获取网页信息并输出信息 阅读全文
posted @ 2020-07-28 19:10 十六m 阅读(238) 评论(0) 推荐(0)
摘要: 一、requests库 1.引入 :import requests 2.基本get 请求: response = requests.get('http://httpbin.org/get')print(response.text) 带参get请求: response = requests.get(' 阅读全文
posted @ 2020-07-28 14:51 十六m 阅读(104) 评论(0) 推荐(0)