python爬蟲實例100例-Python爬蟲 實例

基本GET請求1. 最基本的GET請求可以直接用get方法 response = requests.get("http://www.baidu.com/") 2. 添加 headers 和 查詢參數 如果想添加 headers,可以傳入headers參數來增加請求頭中的headers信息。如果要將參數放在url中傳遞,可以利用 params 參數。 kw = {'wd':'長城'} headers
相關文章
相關標籤/搜索