The article describes a method for identifying elements in spectral lamps using spectral databases and their application across various scientific fields, including astrophysics. A model was developed that utilizes critical and essential information about chemical elements (energy, spectral lines, spectrum). To achieve better results, photographs were also taken using a diffraction grating, showcasing different spectral lamps.