Get frame to frame object location Blender 2.81 +
Object.matrix_world.to_translation()
Recommend using the matrix world,  of the evaluated object. Which is calculated for  each frame of blender. What you see in the UI, is the matrix basis.
Does a child object inherit the matrix from the parent?
Note the local matrix can be gained by multiplying the matrix world of an object, by its parents inverted matrix world. (link above shows how this relates to matrix basis, which is what we set via its components (rot, loc, scale) in the UI)
Here is a quick test script to output the global location of the cube, and evaluated cube for each frame.
There is no need to clear and add a handler for each frame.  Do make sure to clear handlers if running script multiple times as they will accumulate.
import bpy

names = (&quot;Cube&quot;,)
def frame_change_post(scene, dg):
    f = scene.frame_current
    for name in names:
        ob = dg.objects.get(name)
        if ob:
            print(&quot;dg&quot;, ob.name, ob.matrix_world.to_translation()[:])
        ob = scene.objects.get(name)
        if ob:
            print(&quot;scene:&quot;, ob.name, ob.matrix_world.to_translation()[:])
            
        
bpy.app.handlers.frame_change_post.clear()
bpy.app.handlers.frame_change_post.append(frame_change_post)

scene = bpy.context.scene
for f in range(scene.frame_start, scene.frame_end + 1):
    print(f&quot;frame {f} ------------------&quot;)
    scene.frame_set(f)
                

Output of running script.
Here I've run the script above directly from the text editor. The cube has an arbitrary follow path.  Note no difference here between result of un or evaluated object.
frame 1 ------------------
dg Cube (-0.4548962712287903, -7.230154037475586, 0.0)
scene: Cube (-0.4548962712287903, -7.230154037475586, 0.0)
frame 2 ------------------
dg Cube (-0.9097925424575806, -7.199532985687256, 0.0)
scene: Cube (-0.9097925424575806, -7.199532985687256, 0.0)
frame 3 ------------------
dg Cube (-1.357460618019104, -7.115467071533203, 0.0)
scene: Cube (-1.357460618019104, -7.115467071533203, 0.0)
frame 4 ------------------
dg Cube (-1.8044718503952026, -7.026542663574219, 0.0)
scene: Cube (-1.8044718503952026, -7.026542663574219, 0.0)
frame 5 ------------------
dg Cube (-2.238593101501465, -6.889674186706543, 0.0)
scene: Cube (-2.238593101501465, -6.889674186706543, 0.0)

Rendering animation.
dg Cube (-0.4548962712287903, -7.230154037475586, 0.0)
scene: Cube (-2.238593101501465, -6.889674186706543, 0.0)
Saved: '/tmp/0001.png'
 Time: 00:00.42 (Saving: 00:00.01)

dg Cube (-0.9097925424575806, -7.199532985687256, 0.0)
scene: Cube (-2.238593101501465, -6.889674186706543, 0.0)
Saved: '/tmp/0002.png'
 Time: 00:00.31 (Saving: 00:00.01)

dg Cube (-1.357460618019104, -7.115467071533203, 0.0)
scene: Cube (-0.9097925424575806, -7.199532985687256, 0.0)
Saved: '/tmp/0003.png'
 Time: 00:00.34 (Saving: 00:00.01)

dg Cube (-1.8044718503952026, -7.026542663574219, 0.0)
scene: Cube (-1.357460618019104, -7.115467071533203, 0.0)
Saved: '/tmp/0004.png'
 Time: 00:00.34 (Saving: 00:00.01)

dg Cube (-2.238593101501465, -6.889674186706543, 0.0)
scene: Cube (-1.8044718503952026, -7.026542663574219, 0.0)
Saved: '/tmp/0005.png'
 Time: 00:00.33 (Saving: 00:00.01)

dg Cube (-2.238593101501465, -6.889674186706543, 0.0)
scene: Cube (-2.238593101501465, -6.889674186706543, 0.0)