With the development of the Internet of Things (IoT) and intelligent transportation systems (ITS), vehicle ad hoc networks (VANETs) are prone to network congestion and link instability caused by the high mobility of vehicles. Therefore, introducing efficient routing technologies between vehicles can reduce delay and improve reliability. The high-speed mobility of vehicle nodes leads to the rapid change of network topology. Therefore, not only location and speed, but also distance, direction and other parameters should be considered during selecting route weight factors. Given the inefficient routing selection and link instability, this paper proposes a traversal peripheral weight routing selection algorithm. According to the established paths from the source node to the destination node, the algorithm selects the optimal path according to four weight factors: distance between vehicles, the angle value of the vehicle relative to the horizontal direction, link interruption rate, and traffic density. The simulation results show that compared with traditional routing algorithms, the proposed algorithm improves the data transmission rate and link survival time by 25.12\% and 17.68\%, respectively.