Python練習 Response物件

2021-10-06 05:12:35 字數 631 閱讀 5904

前幾天,在中國大學mooc(又稱「慕課」)上發現了python課。課程名稱是python網路爬蟲與資訊提取,授課老師是嵩天老師。推薦給想學習python的小夥伴呀!其實,我自己是python小白,也在學習中喲。

今天,想練習response物件,希望未來的某一天還可以回憶呀。

import requests # 呼叫requests庫

r = requests.get(

"")# 用get方法訪問 慕課學習本課的**

print

(r.status_code)

# 括號內 檢測這個請求的狀態碼

200# 200表示訪問成功,否則,失敗

type

(r)# type檢測r的型別

requests.models.response

# 上面表示乙個class(類)

r.headers # 返回get請求獲得頁面的頭部資訊

# response物件包含伺服器返回的所有資訊,也包含請求的request資訊

加油加油!如果你也在學習python,那就一起加油吧!

(我的第一篇博文,開心!)

Burpsuite設定攔截response

一 burpsuite設定攔截http https 1,攔截修改request 首先進入proxy options intercept client requests設定request攔截的規則 如果不勾選intercept requests based on the following rules...

Respons功能介紹 重定向以及特點

respons物件 功能 設定響應訊息 1.設定響應行 1.格式 http 1.1 200 ok 2.設定狀態碼 setstatus int sc 2.設定響應頭 setheader string name,string value 3.設定響應體 使用步驟 1.獲取輸出流 符輸出流 只能輸出字元資...

python練習100例 Python練習100例

filename cnt 0 count the sum of result fori inrange 1,5 forj inrange 1,5 fork inrange 1,5 ifi j andi k andj k print i 100 j 10 k cnt 1 print cnt 程式 題目...