Robotic welding technology has the characteristics of stable quality and high efficiency. To achieve 3D complex weld tracking in space, a four-step welding seam tracking method is proposed based on segmented scanning, filtering, feature points extraction, and path planning. Through the laser sensor installed at the end of the welding robot, the welding seam data is continuously collected in multiple segments in a segmented scanning manner. In order to improve the tracking accuracy, a combined filtering method is used to correct the data to reduce the effects of burrs, data distortion and noise on the surface of the weldment. Then the feature points are collected and the coordinate system is calibrated to determine the welding points. Finally, the spatial welding path is obtained by path planning. Experimental investigations are carried out for two-dimensional type S and 3D complex welding. The results show that the proposed method can form a complete welding path. The average errors of the two weldments are about 0.296 mm and 0.292 mm respectively, which could fulfill the required accuracy of 0.5 mm. It shows that the proposed tracking method is effective and can provide reference for the research of high-precision tracking and automatic welding.