Link prediction is an essential and challenging problem in research on complex networks, which can provide research tools and theoretical supports for the formation and evolutionary mechanisms of networks. Existing graph representation learning methods based on random walks usually ignore the influence of local network topology on the transition probability of walking nodes when predicting the existence of links, and the sampling strategy of walking nodes during random walks is uncontrolled, which leads to the inability of these methods to effectively learn high-quality node vectors to solve the link prediction problem. To address the above challenges, we propose a novel graph embedding method for link prediction. Specifically, we analyze the evolution mechanism of links based on triadic closure theory and use the network clustering coefficient to represent the aggregation ability of the network’s local structure, and this adaptive definition of the aggregation ability of the local structure enables control of the walking strategy of nodes in the random walking process. Finally, node embedding generated based on biased walking paths is employed to solve the link prediction problem. Extensive experiments and analyses show that the TCW algorithm provides high accuracy across a diverse set of datasets.