#!/usr/bin/env python3
with open('/Applications/XAMPP/xamppfiles/htdocs/aaa/header.php', 'r', encoding='utf-8') as f:
    content = f.read()
idx = content.find('<!-- SureCertificate Mega Menu Fix')
if idx >= 0:
    end = content.find('</script>', idx)
    if end >= 0:
        end += 9
        print('Found block, length:', end - idx)
        print(content[idx:end][:2000])
    else:
        print('No end found')
else:
    print('NOT FOUND')
