To avoid excessive use of herbicides in the weeding operations of Peucedani Radix, a common Chinese herb, a precision seedling avoidance and weeding agricultural robot was designed for the targeted spraying of herbicides. The robot uses YOLOV5 combined with ExG feature segmentation to detect Peucedani Radix and weeds and obtain their corresponding morphological centers. Optimal seedling avoidance and precise herbicide spraying trajectories are generated using a PSO-Bezier algorithm based on the morphological characteristics of Peucedani Radix. Seedling avoidance trajectories and spraying operations are executed using a parallel manipulator with spraying devices. The validation experiments showed that the precision and recall of Peucedani Radix detection were 98.7% and 88.2%, respectively, and the weed segmentation rate could reach 95% when the minimum connected domain was 50. In the actual Peucedani Radix field spraying operation, the success rate of field precision seedling avoidance herbicide spraying was 80.5%, the collision rate between the end actuator of the parallel manipulator and Peucedani Radix was 4%, and the average running time of the parallel manipulator for precision herbicide spraying on a single weed was 2 s. This study can enrich the theoretical basis of targeted weed control and provide reference for similar studies.