首先分析一段简短十分初级的爬虫代码
>>>import requests
>>>r=requests.get("http://www.baidu.com")
>>>print(r.status_code)
200
>>>type(r
本文介绍了Python爬虫初学者如何使用requests库中的Request对象和Response对象。讲解了get方法、status_code判断连接状态、encoding与apparent_encoding的区别、常见异常处理,以及Request对象的head、post等方法的应用,包括params、data、json、headers、cookies、auth、files、timeout、proxies等参数的使用。
首先分析一段简短十分初级的爬虫代码
>>>import requests
>>>r=requests.get("http://www.baidu.com")
>>>print(r.status_code)
200
>>>type(r

被折叠的 条评论
为什么被折叠?
