Sometimes tapeworm infections don't need treatment. The tapeworm can leave the body through the stool. Medication can get rid of some tapeworm infections. To make sure the infection is gone, your health care provider may test your stool multiple times after treatment.