Created
May 11, 2020 20:31
-
-
Save linzino7/4ae18082011ec971a1372a9807589c2e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Created on Tue May 12 02:46:22 2020 | |
@author: Zino | |
""" | |
# 導入 模組(module) | |
import requests | |
# 把 到 ptt 八卦版 網址存到URL 變數中 | |
URL = "https://www.ptt.cc/bbs/Gossiping/index.html" | |
# 設定Header與Cookie | |
my_headers = {'cookie': 'over18=1;'} | |
# 發送get 請求 到 ptt 八卦版 | |
response = requests.get(URL, headers = my_headers) | |
# 印出回傳網頁程式碼 | |
print(response.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment