Somebody has given me this tip for getting urine out of the carpet, if your pet has a mishap.

My best tip is for pet potty spots on the carpet. I use good old white distilled vinegar and baking soda. The steps are the important part. Pour enough white distilled vinegar to soak the stain and THEN add a small amount of baking soda. If you do the reverse, you will have a noisy, bubbly mess. Do it the right way, and you can hear the recipe cackling away, telling you how it is cleaning and deodorizing without leaving any residue. You need to let the spot dry for a day or two before sweeping up and then vacuuming. We cover the spot with a bowl or plate so that we don’t have baking soda kicked from heck to breakfast. You can actually see the yellow color being absorbed up into your little mountain of baking soda. Works on old stains too! 

I haven't tried this yet so don't know if it works. If anyone tries it, let me know how successful it is.

NB: It is not supposed to change the colour of the carpet but if in doubt do a tester on a bit of carpet out of sight first.