1. Changing plant composition in a community can have profound consequences for herbivore and parasitoid population dynamics. To understand such effects, studies are needed that unravel the underlying behavioural decisions determining the responses of parasitoids to complex habitats. 2. T he searching behaviour of the parasitoid Diadegma semiclausum was followed in environments with different plant species composition. In the middle of these environments, two Brassica oleracea plants infested by the host Plutella xylostella were placed. The control set-up contained B. oleracea plants only. In the more complex set-ups, B. oleracea plants were interspersed by either Sinapis alba or Hordeum vulgare. 3. Parasitoids did not find the first host-infested plant with the same speed in the different environments. Sinapis alba plants were preferentially searched by parasitoids, resulting in fewer initial host encounters, possibly creating a dynamic enemy-free space for the host on adjacent B. oleracea plants. In set-ups with H. vulgare, also, fewer initial host encounters were found, but in this case plant structure was more likely than infochemicals to interfere with the searching behaviour of pa 4. On discovering a host-infested plant, parasitoids located the second host-infested plant with equal speed, demonstrating the effect of experience on time allocation. Further encounters with host-infested plants that had already been visited decreased residence times and increased the tendency to leave the environment. 5. Due to the intensive search of S. alba plants, hosts were encountered at lower rates here than in the other set-ups. However, because parasitoids left the set-up with S. alba last, the same number of hosts were encountered as in the other treatments. 6. Plant composition of a community influences the distribution of parasitoid attacks via its effects on arrival and leaving tendencies. Foraging experiences can reduce or increase the importance of enemy-free space for hosts on less attractive plants.