It depends on your priorities. These appear to be black swallowtail butterfly caterpillars, which are amazingly beautiful and which a lot of people would prefer having more than parsley.
There's not much you can do without killing them. You maybe could try buying a bunch of parsley at the store (it's cheap) and seeing if you can move them to it. You can deter them from eating your parsley by mixing some dish soap with water and spraying the plant, but those caterpillars apparently only eat certain things, so they'll die if you prevent them from eating your parsley without giving them an alternative. But people kill caterpillars all the time, so again, whatever your priorities are.