BACKGROUND: Danshen, also known as Salvia miltiorrhiza or radix salvia in Latin, is an important drug whose main pharmacological effects are vasodilation, promotion of blood circulation, and elimination of stasis. In recent years, it has been reported that danshen also has anti-tumor activity. OBJECTIVE: The aim of this study was to explore the feasibility and potential mechanism of S. miltiorrhiza in the treatment of gastric cancer. STUDY DESIGN: We analyzed effective components and target genes of S. miltiorrhiza in the Traditional Chinese Medicine System Pharmacology (TCMSP) database and analysis platform. We then searched the GeneCards database for target genes related to gastric cancer and the intersection of these genes with the active components of S. miltiorrhiza. Target genes related to gastric cancer were taken as common potential target genes of S. miltiorrhiza, which could act on gastric cancer. Using the R programming language, we drew a Venn map of these common potential target genes. The "component-target gene-disease" network of S. miltiorrhiza in the treatment of gastric cancer was established using Cytoscape software version 3.7.1; the protein-protein interaction (PPI) network was constructed in the Search Tool for the Retrieval of Interacting Genes/Proteins (STRING) database. With the help of R and Perl languages, we performed gene ontology (GO) function and Kyoto Encyclopedia of Genes and Genomes (KEGG) pathway enrichment analyses of potential target genes of S. miltiorrhiza in the treatment of gastric cancer. RESULTS: We extracted a total of 65 active components from S. miltiorrhiza, including dihydrotanshinone I and miltionones I and II, as well as 102 potential target genes for gastric cancer. According to the Degree ranking in Cytoscape3.7.1 software, the top 10 potential target genes were protein kinase B1 (AKT1), interleukin-6 (IL-6), vascular endothelial growth factor A (VEGFA), epidermal growth factor receptor (EGFR), Fos, mitogenactivated protein kinase 1 (MAPK1), Myc, JUN, Caspase-3 (CASP3), and signal transducer and activator of transcription 3 (STAT3). Pathway enrichment mainly involved signaling pathways such as phosphoinositide 3-kinase (PI3K)-Akt, hypoxiainducible factor 1 (HIF-1), and IL-17. CONCLUSION: Based on network pharmacology, S. miltiorrhiza is expected to be mined as a candidate Traditional Chinese Medicine (TCM) for the treatment of gastric cancer. Its mechanism for treating this cancer operates via multiple components and pathways. This study provides the basic theory and the basis for further research.