Shaving cream? How does that work? The areas can be liek 2’x2’ in size.
Rub it in and wipe it up with a dry cloth for spots.
If you’re going to clean with a carpet cleaner, spot clean with shaving cream as a pre cleaner and then clean the carpet with the machine.
I use Barbasol.