import pywikibot
import re
site = pywikibot.Site('zh', 'wikipedia')
site.login()
csdcat = pywikibot.Category(site, "Category:快速删除候选")
for page in csdcat.articles():
    x = page
    print("頁面名", page.title())
    print("貢獻者", len(page.contributors()), page.contributors())
    found = False
    for template in page.templatesWithParams():
        if template[0].title() in ["Template:Delete", "Template:D"]:
            print("刪除理由", template[1])
            found = True
    if not found:
        print(page.templatesWithParams())
    for revision in page.revisions():
        print(revision)
    break
頁面名 File talk:Music Creator Concert CD cover 2011.jpg
貢獻者 2 Counter({'MCC214': 1, 'Jasonjiang.1998': 1})
刪除理由 ['g15']
{'revid': 50261797, 'text': None, 'timestamp': Timestamp(2018, 7, 5, 8, 14, 50), 'user': 'MCC214', 'anon': False, 'comment': '请求快速删除([[WP:CSD#G15|CSD G15]])', 'minor': False, 'rollbacktoken': None, '_parent_id': 45492257, '_content_model': 'wikitext', '_sha1': '1129a2ebc00f6a474632314468909740abd3b6b9'}
{'revid': 45492257, 'text': None, 'timestamp': Timestamp(2017, 8, 2, 16, 32, 36), 'user': 'Jasonjiang.1998', 'anon': False, 'comment': '/* 删除争议 */ 新章节', 'minor': False, 'rollbacktoken': None, '_parent_id': 0, '_content_model': 'wikitext', '_sha1': '2553aaaa3e98d1dfe6df989879e5e4b3df2ff993'}
for page in csdcat.subcategories():
    print(page)
[[zh:Category:前610年出生]]