If you’re talking about just a screenshot that you take as the computer owner, most operating systems have a screenshot tool built in. For Windows there is power toys snipping tool as well, or pros often use something more professional like TechSmith snagit, which have features like scrolling screenshot assembly.
I think that’s what you’re asking about- in the designer switch to mobile breakpoint. In snagit (paid) enable scrolling screenshots and then you scroll-capture your content.
If you’re talking about taking a screenshot using JavaScript from within the webpage, e.g. building some form of support tool, you’re probably limited to the page content of the current tab for security reasons. But that’s where you’d start your research.