This module solves the problem of annoying CSRF problem.
So you can write scripts by simply import dcard
.
pip install dcard
(What an awesome name!)
from dcard import Dcard
d = Dcard('<USERNAME>', '<PASSWORD>')
# get info about yourself
data = d.session.get('https://www.dcard.tw/api/member/status').json()