Have a look and listen to these examples:
Cuando voy al trabajo, voy por el parque.
When I go to work, I go through the park.
Los chicos metieron el sofá en la casa por la ventana.
The guys got the sofa inside the house through the window.
Miguel espiaba a su vecino por el agujero de la pared.
Miguel spied on his neighbour through the hole in the wall.
But it could also express "along" a place, for example when you walk along a street or an avenue (you walk the length of a street) or walk along a beach, for example.
Sigue recto por la avenida de América.
Continue straight along America Avenue.
Me encanta caminar por la orilla de la playa por la tarde.
I love walking along the shore in the evening.
Learn more about these related Spanish grammar topics
Examples and resources
Me encanta caminar por la orilla de la playa por la tarde.
I love walking along the shore in the evening.
Sigue recto por la avenida de América.
Continue straight along America Avenue.
Los chicos metieron el sofá en la casa por la ventana.
The guys got the sofa inside the house through the window.
Miguel espiaba a su vecino por el agujero de la pared.
Miguel spied on his neighbour through the hole in the wall.
Cuando voy al trabajo, voy por el parque.
When I go to work, I go through the park.