How to extract energy history output using python? (ALLSE)

I am trying to create a small code to extract history output like the ALLSE for each remeshing done during my entire simulation. However, I am facing big difficulties since I cannot manage to get this energy data. Does someone has done something similar before?

Many thanks in advance