A theoretical study of the K-shell total photoabsorption and photoionization cross section spectra of water and ammonia bonded to benzene (C6H6) and the polycyclic aromatic hydrocarbons (PAHs) naphthalene (C10H8), coronene (C24H12) and circumcoronene (C54H18) by van der Waals (vdW) forces is presented. The discretized electronic pseudospectra at the oxygen and nitrogen K-edges, covering the discrete and the continuum spectral regions, were obtained at the time-dependent density functional theory (TDDFT) level with dispersion correction. An analytic continuation procedure based on the Padé approximants was used in order to obtain the K-shell cross sections of the structures at the discrete and the continuum regions of the spectra. By examining the electronic spectra of water and ammonia bonded to coronene and circumcoronene, we observed that our results agree well with the experiments performed with graphene. This work provides a quantum mechanical interpretation to the NEXAFS experiments of water and ammonia adsorbed on graphene in terms of a physisorption model of these molecules by van der Waals forces.