Rinse shredded potatoes in a colander with cold water until water runs clear. Place in a cheesecloth or clean dish towel and twist tightly to squeeze out all moisture.
Place potatoes in a bowl with onion, flour, salt, and pepper. Add egg and mix thoroughly.
Heat oil in a shallow, cast iron frying pan. Add potato mixture to the hot oil to form either on large or several smaller pancakes. Cook until browned and crispy, about 5 minutes per side. Drain on a paper towel and serve hot.