Finely grate the potatoes and onion. Press out as much liquid as possible with your hands, then spread it out on a clean kitchen towel and roll it up to remove any remaining moisture.
Place the grated vegetables in a bowl and stir in the flour, egg, salt and black pepper.
Heat the oil in a frying pan until medium-high heat. Drop small/large spoons of the mixture into the pan, pressing with spoon to flatten, and fry in batches, turning once, for 5–7 minutes until the latkes are golden brown and cooked through.
Drain the latkes on kitchen paper and keep warm while you cook the remaining mixture. Serve hot with sour cream and green onions.