python爬虫实例100例-Python爬虫 实例

基本GET请求1. 最基本的GET请求可以直接用get方法 response = requests.get("http://www.baidu.com/") 2. 添加 headers 和 查询参数 如果想添加 headers,可以传入headers参数来增加请求头中的headers信息。如果要将参数放在url中传递,可以利用 params 参数。 kw = {'wd':'长城'} headers
相关文章
相关标签/搜索