Recording Spectral Lines at Home
Here is a link to a diffraction grating that can do what you want. It is mounted in a 1.25" filter ring that attaches to an eyepiece, or to most astro cameras. I believe they also sell adapters for other cameras and software to extract spectra from the photos.

Here is a link to a spectra of Vega that I took with a 120 mm refractor using  the Star Analyser grating.