requests套件 - 以HTTP request向網站請求資料

  • 印出HTTP response status code "200"代表請求成功,requests已取得資料,放入變數r
import requests

url = 'https://www.dcard.tw'
r = requests.get(url)
print(r.status_code)

results matching ""

    No results matching ""