Pagesource is a command-line tool designed to capture and dump the runtime sources of a website, providing a more accurate representation of the site's structure for local language model (LLM) context. Unlike the traditional "Save As" feature in browsers that flattens the webpage into a single HTML file, Pagesource preserves the actual file structure, including separate JavaScript modules, CSS files, and lazy-loaded resources. Built on Playwright, it allows developers to access all dynamically loaded JS modules and maintain the original directory structure, making it particularly useful for web developers who need to replicate or analyze website components effectively. This matters because it enhances the ability to work with LLMs by providing them with a more detailed and accurate context of web resources.
Read Full Article: Pagesource: CLI Tool for Web Dev with LLM Context