import sys with open('dungeons/index.html', 'r', encoding='utf-8') as f: text = f.read() target = ''' 古城アムダプール (Hard) Lv50 (IL90〜) 非対応 真菌汚染。ボギー、ボジャノイド。 準備中 ''' replacement = ''' 古城アムダプール (Hard) Lv50 (IL90〜) 非対応 真菌汚染。ボギー、ボジャノイド。 攻略を見る ➜ ''' if target in text: text = text.replace(target, replacement) with open('dungeons/index.html', 'w', encoding='utf-8') as f: f.write(text) print("Updated amdapor_keep_hard in dungeons/index.html") else: print("Target not found!") sys.exit(1)