Cut the potatoes into thin slices, about 1/4 inch thick or, if you can manage it, even thinner. Use a mandoline slicer for best results.
Do the same with the onions.
Heat the olive oil in a frying pan. Over medium heat, fry the potato slices. Stir them around gently to make sure that no slices are sticking together.
Add the onion slices to the potatoes. Continue frying until the potatoes are cooked through and the onion slices have softened. Note that you are not making potato chips here. Don't expect the potato slices to brown and turn crisp. You don't want to overcook them either until they fall apart when lifted. You just want to make sure that they are cooked all the way through.
Strain the potato and onion slices.
Pour the oil off the frying pan (you may reuse it) leaving only enough to coat the bottom lightly.
Beat the eggs with salt and pepper in a mixing bowl. I use a generous pinch of salt and a small pinch of pepper for every egg.
Add the potato and onion slices to the beaten eggs. Stir them gently to allow the beaten eggs to seep between them.
Reheat the cooking oil in the frying pan. Pour in the egg, potato and onion mixture. Set the heat to low. Cover the pan. Allow the torta to cook for about ten minutes.
Loosen the sides and bottom of the torta with a spatula. Check if the sides and bottom have browned nicely. At this point, the eggs will still be a little raw at the center but the sides should be firm.
Place a plate (should be wider than the pan), upside down, on top of the pan. Pressing down on the plate with one hand and holding the pan with the other, invert the torta on the plate.
Drizzle more olive oil to coat the bottom of the pan. Reheat. Slide the torta back into the pan, cover and cook for another five minutes.
Cool the Spanish torta a little before slicing.
To serve, sprinkle with chopped parsley and, optionally, drizzle with extra virgin olive oil.