I think I once saw a video of a caterpillar that could get infected by a parasite, and could die of that, unless a specific kind of spider would eat the parasite, and so once the caterpillar is infected it goes looking for that spider. I can't find that video anymore though, nor any reference on this, so I'm beginning to doubt myself. Does this behaviour really exist?
Oddly enough it is a bit difficult to find good field studies where the diet of spiders was studied. I have a feeling it's a hard thing to get funding for. Luckily some do exist.
Peucetia viridans has been shown to eat from the Chrysididae family and Lepidoptera order, but I didn't find an explicit statement that it ate the larvae out of the caterpillar. Likewise Oxyopes globifer was found to have eaten from the Braconidae family and Lepidotera.
At this point you might be wondering why I'm looking for spiders that have been shown to eat both parasitoids (Chrysididae and Braconidae) and caterpillars (Lepidotera). It my assumption that in the scenario you describe a spider that would normal eat ether the caterpillar or the larvae would be just as happy to eat them both if it was lucky enough to find them.
I never saw the video you were talking about, and I too could not find it. It is not unreasonable to assume that an opportunistic spider wouldn't just take the opportunity to feed on both, or that it might find the larvae more tasty and just eat them. I've not found a spider seeking caterpillar as of yet.