--- id: nokap version: "0.1.0" license: MIT License Copyright (c) 2026 Richard Iannone Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to… (full text in the JSON record) license_treatment: permissive maintenance: active --- # nokap — Capture screenshots and PDFs from web pages using headless Chrome via CDP. License: permissive · Maintenance: active · Downloads: 516.7K/mo ## What it is and what it does nokap is a lightweight Python library for capturing screenshots and PDFs from web pages or HTML strings using headless Chrome. It communicates directly with Chrome via the Chrome DevTools Protocol over WebSockets, eliminating the need for browser driver binaries or heavyweight automation frameworks. The library launches and manages a headless Chrome process, connects via CDP, and uses Chrome's native capture methods to render pages to PNG, JPEG, WebP, or PDF formats. The package is designed for developers who need straightforward web-to-image or web-to-PDF conversion without the complexity of larger automation tools. It supports CSS selectors to capture specific elements, viewport control for responsive layouts, zoom scaling for retina-quality output, and rendering of HTML strings directly. Chrome or Chromium must be installed separately on the system; nokap will locate it automatically. The library is typed, actively maintained, and supports Python 3.10 through 3.13. Use it for: - Generate thumbnails or previews of web pages for display in dashboards or content management systems - Export HTML reports or tables rendered by libraries directly to PDF or image files - Capture specific page elements using CSS selectors for automated documentation generation - Convert dynamically generated HTML from templates or data to static images without a full browser - Create retina-quality screenshots for design mockups or testing responsive layouts at different scales ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. nokap captures screenshots and PDFs from web pages or HTML strings using headless Chrome via the Chrome DevTools Protocol, without requiring Selenium or Playwright. Yes, if you need simple web-to-image or web-to-PDF capture and already have Chrome or Chromium installed. The low dependency footprint, active maintenance, and permissive MIT license make it a practical choice over heavier frameworks. No known vulnerabilities. Install it if you want straightforward screenshot and PDF generation without Selenium or Playwright overhead; skip it if you need advanced browser automation or don't have Chrome available. ## Install pip install nokap uv add nokap poetry add nokap ## Installing nokap Before you install: Low friction: pure Python wheel with only two runtime dependencies (websockets and click). Active maintenance as of June 2026. Requires Chrome or Chromium to be installed on the system separately. License in practice: MIT License permits unrestricted use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects. Quickstart: pip install nokap import nokap nokap.webshot("https://example.com", "example.png") nokap.from_html("Hello, world!", "hello.png") Chrome or Chromium must be installed on the system; nokap will locate it automatically. Verify before relying: - Whether Chrome binary discovery works reliably across different system configurations and installation methods - Performance characteristics when capturing many pages or large documents in sequence - Stability and resource usage of the persistent Chrome process across long-running applications ## Package facts - License: MIT License Copyright (c) 2026 Richard Iannone Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 516.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags screenshot web pages headless chrome, pdf generation from html, chrome devtools protocol automation, capture webpage as image, headless browser screenshot tool, html to png converter, web page rendering automation, web-automation, screenshot-generation, pdf-export [View on SkillFed](https://skillfed.io/packages/nokap) · [View on PyPI](https://pypi.org/project/nokap/)