String correlation analysis, Cytoscape network topology analysis, core target screening, protein molecule docking, immunohistochemical expression levels, and survival immune correlation analysis revealed that the carcinogenic genes JUN, HIF1A, and PTGS2 may be the primary drug targets for Hairyvein Agrimonia Herb in treating gastric cancer. This evidence concerns the gene JUN and gastric cancer.