from urllib import request
import requests
from bs4 import BeautifulSoup

url='https://www.ptt.cc/bbs/joke/index.html'



userAgent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36'
headers= {
    'User-Agent' : userAgent
}

articalUrl= "https://www.ptt.cc/bbs/movie/M.1628251622.A.0D8.html"
resArtical =requests.get(articalUrl, headers=headers)

soupArticle = BeautifulSoup(resArtical.text,'html.parser')
# print(soupArticle.text)
articleContent = soupArticle.select('div[id="main-content"]')[0].text.split('※ 發信站:')[0]

print(articleContent)
2fabff7ccac7e1af85f6346205c9cb416f4b3f46
<mask token>

<mask token>
print(articleContent)

<mask token>
url = 'https://www.ptt.cc/bbs/joke/index.html'
userAgent = (
    'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36'
    )
headers = {'User-Agent': userAgent}
articalUrl = 'https://www.ptt.cc/bbs/movie/M.1628251622.A.0D8.html'
resArtical = requests.get(articalUrl, headers=headers)
soupArticle = BeautifulSoup(resArtical.text, 'html.parser')
articleContent = soupArticle.select('div[id="main-content"]')[0].text.split(
    '※ 發信站:')[0]
print(articleContent)

from urllib import request
import requests
from bs4 import BeautifulSoup
url = 'https://www.ptt.cc/bbs/joke/index.html'
userAgent = (
    'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36'
    )
headers = {'User-Agent': userAgent}
articalUrl = 'https://www.ptt.cc/bbs/movie/M.1628251622.A.0D8.html'
resArtical = requests.get(articalUrl, headers=headers)
soupArticle = BeautifulSoup(resArtical.text, 'html.parser')
articleContent = soupArticle.select('div[id="main-content"]')[0].text.split(
    '※ 發信站:')[0]
print(articleContent)

from urllib import request
import requests
from bs4 import BeautifulSoup

url='https://www.ptt.cc/bbs/joke/index.html'



userAgent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36'
headers= {
    'User-Agent' : userAgent
}

articalUrl= "https://www.ptt.cc/bbs/movie/M.1628251622.A.0D8.html"
resArtical =requests.get(articalUrl, headers=headers)

soupArticle = BeautifulSoup(resArtical.text,'html.parser')
# print(soupArticle.text)
articleContent = soupArticle.select('div[id="main-content"]')[0].text.split('※ 發信站:')[0]

print(articleContent)