The 31 main components of Lianhua Qingwen (LHQW) were obtained through a literature and database search; the components included glycyrrhizic acid, emodin, chlorogenic acid, isophoroside A, forsythia, menthol, luteolin, quercetin, and rutin. Sixty-eight common targets for the treatment of novel coronavirus pneumonia (NCP) and influenza virus pneumonia (IVP) were also obtained. A “component-target-disease” network was constructed with Cytoscape 3.2.1 software, and 20 key targets, such as cyclooxygenase2 (COX2), interleukin-6 (IL-6), mitogen-activated protein kinase14 (Mapk14), and tumor necrosis factor (TNF), were screened from the network. The David database was used to perform a Kyoto Encyclopedia of Genes and Genomes (KEGG) signal pathway enrichment analysis and gene ontology (GO) biological process enrichment. Results showed that the key targets of LHQW in the treatment of NCP and IVP mainly involved biological processes, such as immune system process intervention, cell proliferation, apoptosis and invasion, toxic metabolism, cytokine activity, and regulation of the synthesis process. KEGG enrichment analysis revealed that 115 signalling pathways were related to the treatment of LHQW. Amongst them, IL-17, T cell receptor, Th17 cell differentiation, TNF, toll-like receptor, MAPK, apoptosis, and seven other signalling pathways were closely related to the occurrence and development of NCP and IVP. Molecular docking showed that each component had different degrees of binding with six targets, namely, 3C-like protease (3CL), angiotensin-converting enzyme 2 (ACE2), COX2, hemagglutinin (HA), IL-6, and neuraminidase (NA). Rutin, isoforsythiaside A, hesperidin and isochlorogenic acid B were the best components for docking with the six core targets. The first five components with the best docking results were isoforsythiaside, hesperidin, isochlorogenic acid B, forsythin E, and quercetin. In conclusion, LHQW has many components, targets, and pathways. The findings of this work can provide an important theoretical basis for determining the mechanism of LHQW in treating NCP and IVP.