Those caterpillars eating your parsley may be the larvae of the Swallowtail butterfly. Plant a variety of flowers that bloom from spring until fall. They will provide a continuous source of nectar for the adult butterflies. Include native plant species in your garden. While adults are attracted to a wide variety of flowers, many have a preference for red, yellow, orange, and purple flowers.
Single flowers are easier for butterflies to get nectar from than the fuller double blossoms.
Locate your garden in full sun. Butterflies are most active on warm sunny days. Provide a source of water such as a shallow saucer of water or a birdbath. Butterflies do drink. Place several flat rocks in full sun in the garden.