washer won't spin

I have a whirlpool top load washer that will not spin out at the end of the wash cycle when it is draining unless I open and close the lid. It does spin on all other cycles.

It sounds like the lid switch is not making contact. Without the model #, we don’t know which model you have. On the when that has the lid switch on the back left hand corner, sometimes the metal rod, that slides into the lid switch assembly gets bent. If you were to unplug the washer, and open the lid, and stick your arm in the back left hand corner, you will feel and thin metal rod. What you need to do is hold the lid open, and push hard on the metal rod towards the back, and then close the lid, and give it a try. If the lid switch is on the right side in the middle, just replace it. Tom