Peel and shred the potatoes using a grater. Rinse the shredded potatoes until the water is clear and then drain and squeeze dry. Place the potatoes shreds in a bowl and mix in the onion, flour, and egg until well combined.
Heat about 1/4 inch of oil in a large heavy skillet over medium-high heat. When the oil is hot, place the potatoes into the pan in a layer that is about 1/2 inch thick. Cover the whole bottom of the pan, or make separate piles like pancakes. Cook until nicely browned on the bottom, then flip over and cook until browned on the other side. It should take at least 5 minutes per side. If you are cooking them in one big piece, it can be cut into quarters for easier flipping.
Remove from pan, and drain on a plate lined with paper towels. Season with salt and pepper and serve immediately.