# -*- coding: utf-8 -*- import sys from normalize_util import normalize_file with open('dungeons/index.html', 'r', encoding='utf-8') as f: lines = f.readlines() found = False for i in range(len(lines)): if 'シリウス大灯台' in lines[i] and 'Hard' not in lines[i]: for k in range(i, min(len(lines), i+6)): if '準備中' in lines[k]: lines[k] = lines[k].replace('準備中', '攻略を見る ➜') found = True break if found: break if found: with open('dungeons/index.html', 'w', encoding='utf-8') as f: f.writelines(lines) normalize_file('dungeons/pharos_sirius.html') normalize_file('dungeons/index.html') print("更新成功") else: print("シリウスノーマルが見つかりません") sys.exit(1)