Wenxin Keli (WXKL) is a traditional Chinese medicine drug approved for the treatment of cardiovascular diseases. This study aimed to identify WXKL-targeting genes involved in antiarrhythmic efficacy of WXKL. The Traditional Chinese Medicine Systems Pharmacology (TCMSP) technology platform was used to screen active compounds of WXKL and WXKL-targeting arrhythmia-related genes. A pig model of myocardial ischemia (MI) was established by balloon-expanding the endothelium of the left coronary artery. Pigs were divided into the model group and WXKL group (n = 6). MI, QT interval, heart rate, and arrhythmia were recorded, and the mRNA expression of target genes in myocardial tissues was detected by PCR. Eleven active ingredients of WXKL and eight WXKL-targeting arrhythmia-related genes were screened. Five pathways were enriched, and an “ingredient-gene-path” network was constructed. WXKL markedly decreased the incidence of arrhythmia in the MI pig model (P<0.05). The QT interval was significantly shortened, and the heart rate was slowed down in the WXKL group compared with the model group (P<0.05). In addition, the expression of sodium channel protein type 5 subunit alpha (SCN5A) and beta-2 adrenergic receptor (ADRB2) was downregulated, while muscarinic acetylcholine receptor M2 (CHRM2) was upregulated in the WXKL group (P<0.05). In conclusion, WXKL may shorten the QT interval and slow down the heart rate by downregulating SCN5A and ADRB2 and upregulating CHRM2 during MI. These findings provide novel insight into molecular mechanisms of WXKL in reducing the incidence of ventricular arrhythmia.