I would like to spawn an object at the player's position every time they press a button. My player node has a child node that spawns the objects, but I don't know how to pass the player's position to that node
How to place an object at the player's position?
Children keep up with their parents. Assuming your spawner isn't far off from your player, obj.global_position = global_position
places the object at the exact location of the spawner. Ideally the spawner is in the position you'd want the object you want spawned, so assigning the spawned object's global position to the spawner's global position should be good enough.
However if you want your parent's position specifically:
obj.global_position = get_parent().global_position