Traditional Chinese medicine treatment of diseases has been recognized, but the material basis and mechanisms are not clear. In this study, target prediction of the antigastric cancer (GC) effect of Guiqi Baizhu (GQBZP) and the analysis of potential key compounds, key targets, and key pathways for the therapeutic effects against GC were carried out based on the method of network analysis and Kyoto Encyclopedia of Genes and Genomes enrichment. There were 33 proteins shared between GQBZP and GC, and 131 compounds of GQBZP had a high correlation with these proteins, indicating that the PI3K‐AKT signaling pathway might play a key role in GC. From these studies, we selected human epidermal growth factor receptor 2 (HER2) and programmed cell death 1‐ligand 1 (PD‐L1) for docking; the results showed that 385 and 189 compounds had high docking scores with HER2 and PD‐L1, respectively. Six compounds were selected for microscale thermophoresis (MST). Daidzein/quercetin and isorhamnetin/formononetin had the highest binding affinity for HER2 and PD‐L1, with Kd values of 3.7 μmol/L and 490, 667, and 355 nmol/L, respectively. Molecular dynamics simulation studies based on the docking complex structures as the initial conformation yielded the binding free energy between daidzein/quercetin with HER2 and isorhamnetin/formononetin with PD‐L1, calculated by molecular mechanics Poisson‐Boltzmann surface area, of −26.55, −14.18, −19.41, and −11.86 kcal/mol, respectively, and were consistent with the MST results. In vitro experiments showed that quercetin, daidzein, and isorhamnetin had potential antiproliferative effects in MKN‐45 cells. Enzyme activity assays showed that quercetin could inhibit the activity of HER2 with an IC50 of 570.07 nmol/L. Our study provides a systematic investigation to explain the material basis and molecular mechanism of traditional Chinese medicine in treating diseases.