I have this same issue and asked the same question a couple years ago. Of all the responses I got, here's the one I found works best. It's from Janie:
"My Mom gave me a spray bottle of her "miracle stain remover" when my son was born 4-1/2 yrs ago (one part rubbing alcohol, 3 parts water and a small squirt (possibly a 1/4 tsp.) of liquid dish soap. Spay it on till it's not soaked but thoroughly wet; use a small scrub brush on the stain and then blot it up with paper towels. Use the spray (with or without scrubbing) and blotting until the stain is gone. When the carpet is dry, just vaccume. This is also an awesome stain remover for clothes.....just spray when the stain occurs (or even when you find it before putting it in the washer). It won't hurt to spray it and leave it a couple of days in the hamper either. I used (and still use!!) this religously when my son was a baby on all of his clothes, spit-up rags (and you know how smelly and stained they can get!!), bedding, etc. and there are absolutely NO stains on any of his baby things!! I also use it on the carpet when the cats and dogs get sick or have accidents. I pre-mix enough to put into a 1/2 gallon jug and then just fill the spray bottle when I run low. Give it a try and let me know how it works."
This stuff really works fantastically and is much cheaper making than buying some other product. Good luck!