Identifying drug-target interactions (DTIs) is a major challenge for current drug discovery and drug repositioning. At present, using computer methods to predict DTIs is a very important step in the discovery of new drugs and drug relocation processes. The potential DTIs identified by machine learning methods can provide guidance in biochemical or clinical experiments. This paper proposes a DTI prediction method based on deep walking across heterogeneous networks. The method uses a network representation learning (NRL) algorithm (large-scale information network embedding (LINE)) to extract the network topology features of the drug and target, integrates the features obtained from heterogeneous networks, and finally uses the random forest (RF) algorithm to predict the interaction of drug and target. We find LINE-RF to be the most suitable algorithm for extracting the network features of drugs and targets. In the best prediction result, the area under the receiver operating characteristic (ROC) curve (AUC) reaches 0.9349, and the area under the precision recall curve (AUPR) reaches 0.9016. Compared to the traditional methods of drug-target prediction, this method provides more sufficient network information for predicting classifiers. The learning method based on the LINE network can effectively learn multiple hidden features from network topological relationships, such as drugs, targets, and diseases, and then integrate the features obtained from multiple networks. Finally, the classification prediction using the RF algorithm is an effective model.