काला background दिखने पर पहले यह जाँचें कि पेज की CSS वास्तव में काली है या screenshot पारदर्शी है और आपका viewer उसे काले रंग पर दिखा रहा है। Puppeteer में omitBackground: true पारदर्शिता देता है—यह सफेद रंग लगाने या किसी काले CSS background को हटाने का विकल्प नहीं है। सफेद या किसी दूसरे ठोस रंग के लिए capture से पहले पेज की CSS बदलें।
पहले तय करें: आपको पारदर्शी background चाहिए या ठोस रंग?
| आपका लक्ष्य | क्या करें | ध्यान रखें |
|---|---|---|
| पारदर्शी PNG | page.screenshot({ type: 'png', omitBackground: true }) इस्तेमाल करें। |
दस्तावेज़ के अनुसार omitBackground का default false है; इसे true करने पर Puppeteer default सफेद background छिपाता है और transparency की अनुमति देता है। |
| सफेद या कोई और ठोस रंग | पेज की CSS में वह रंग लागू करें और सामान्य screenshot लें। | omitBackground transparency के लिए है, CSS में मौजूद काले background को override करने के लिए नहीं। |
| केवल एक element | उस element के handle पर screenshot() कॉल करें। |
Puppeteer जरूरत पड़ने पर element को view में लाने के लिए scroll करने की कोशिश करता है। |
काले screenshot का कारण कैसे पता करें
- Environment दर्ज करें। Puppeteer package version, browser और उसका version, launch options (खासकर headless mode), screenshot format और इस्तेमाल किए गए सभी screenshot options नोट करें। यह भी लिखें कि image किस viewer या processing pipeline में काली दिख रही है।
- Rendered page की CSS देखें।
html,bodyऔर पूरे viewport को ढकने वाले container के computedbackground-colorऔरbackground-imageजाँचें। CSS variables, बड़े overlay और page scripts से लागू styles भी देखने लायक हैं। किसी एक reproduction के बिना इनमें से किसी को तयशुदा कारण नहीं कहा जा सकता। - पुष्टि करें कि page तैयार है। जाँचें कि navigation के बाद जरूरी styles और scripts लागू हो चुके हैं। केवल navigation event पूरा होना इस बात की गारंटी नहीं है कि हर page-specific render पूरा हो गया है।
- अगर transparency माँगी थी, तो output जाँचें। PNG को alpha transparency समझने वाले viewer में खोलें या किसी ज्ञात background पर देखें। यह पता लगाना जरूरी है कि काला रंग image में है या उसे दिखाने वाला अगला tool पारदर्शी हिस्से को काले पर render कर रहा है।
- एक बदलाव करके दोबारा capture करें। उसी environment में स्पष्ट background वाली साधारण test page लें। पहले सामान्य screenshot और फिर transparent screenshot की तुलना करें। बिना reproducer के launch flags बदलने से समस्या का कारण छिप सकता है।
Node.js में समस्या जाँचने और screenshot लेने का तरीका
1. Puppeteer और browser versions दर्ज करें
एक नए folder में Puppeteer install करें:
npm install puppeteer
फिर इस script को capture.cjs नाम से सहेजें। TARGET_URL को उस page के URL से बदलें जहाँ समस्या दिख रही है। Script versions और page backgrounds छापती है, फिर सामान्य PNG और transparent PNG दोनों बनाती है।
const puppeteer = require('puppeteer');
(async () => {
const targetUrl = process.env.TARGET_URL || 'https://example.com';
const browser = await puppeteer.launch({ headless: true });
try {
console.log('Puppeteer:', require('puppeteer/package.json').version);
console.log('Browser:', await browser.version());
const page = await browser.newPage();
await page.setViewport({ width: 1440, height: 900 });
await page.goto(targetUrl, { waitUntil: 'domcontentloaded', timeout: 60000 });
const backgrounds = await page.evaluate(() => {
const selectors = ['html', 'body'];
return selectors.map((selector) => {
const element = document.querySelector(selector);
if (!element) return { selector, found: false };
const style = getComputedStyle(element);
return {
selector,
found: true,
backgroundColor: style.backgroundColor,
backgroundImage: style.backgroundImage,
};
});
});
console.log('Computed backgrounds:', JSON.stringify(backgrounds, null, 2));
await page.screenshot({ path: 'page.png', type: 'png' });
await page.screenshot({
path: 'page-transparent.png',
type: 'png',
omitBackground: true,
});
} finally {
await browser.close();
}
})().catch((error) => {
console.error(error);
process.exitCode = 1;
});
इसे चलाएँ:
TARGET_URL=https://example.com node capture.cjs
Windows PowerShell में environment variable इस तरह सेट करें:
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
$env:TARGET_URL = "https://example.com"; node .capture.cjs
यह script html और body की computed styles दिखाती है; यदि कोई दूसरा element viewport ढक रहा हो तो उसके selector को भी जाँच में जोड़ें। दोनों output files अलग-अलग खोलें। यदि सामान्य image में background काला है, तो page styles देखें। यदि काला केवल transparent output में दिखता है, तो alpha-aware viewer से जाँचें।
2. सफेद background को capture तक सीमित रखें
यदि आपको सफेद output चाहिए, तो screenshot से पहले उपयुक्त selectors पर CSS लागू करें। नीचे का उदाहरण केवल html और body बदलता है; किसी site का रंग किसी दूसरे container या pseudo-element से आ रहा हो तो selectors उसके अनुसार बदलें।
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
await page.addStyleTag({
content: 'html, body { background-color: #fff !important; }',
});
await page.screenshot({ path: 'page-white.png', type: 'png' });
page.addStyleTag() page में style block या linked stylesheet जोड़ने का Puppeteer तरीका है। यह capture के दौरान page की दिखावट बदलता है; site पर सही selector चुनना आपकी rendered page पर निर्भर है।
Transparent PNG और सफेद screenshot के सही उदाहरण
पारदर्शी PNG
await page.screenshot({
path: 'page.png',
type: 'png',
omitBackground: true,
});
PNG चुनें, omitBackground को स्पष्ट रूप से true करें और image को alpha-aware viewer में जाँचें। यदि downstream tool transparency हटाता है या उसे किसी रंग पर दिखाता है, तो उसका व्यवहार भी जाँचें।
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
सफेद PNG
await page.addStyleTag({
content: 'html, body { background-color: #fff !important; }',
});
await page.screenshot({ path: 'page.png', type: 'png' });
यह CSS उदाहरण है, सभी websites के लिए सार्वभौमिक fix नहीं। अगर सफेद रंग लागू नहीं होता, तो पता करें कि वास्तविक background किस element, pseudo-element या background image से आ रहा है।
Page screenshot और element screenshot में चुनाव
पूरे rendered page के लिए Page.screenshot() इस्तेमाल करें। किसी एक card, chart या दूसरे target के लिए पहले उसे चुनें और फिर उसके handle का screenshot लें:
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
const element = await page.$('.target-element');
if (!element) throw new Error('Target element नहीं मिला');
await element.screenshot({ path: 'element.png' });
Selector को अपने page के अनुसार बदलें। Element का screenshot लेने से पूरे page के background की CSS अपने-आप ठीक नहीं होती; target element की अपनी styling भी जाँचें।
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Version और headless mode को कैसे समझें
इस लेख की तारीख 3 अक्टूबर 2026 है। Puppeteer का browser mapping समय के साथ बदल सकता है, इसलिए अपने installed package और चल रहे browser के versions को output में दर्ज करना अनुमान लगाने से बेहतर है। Puppeteer के browser-support विवरण के अनुसार v20.0.0 से Puppeteer Chrome for Testing डाउनलोड और उपयोग करता है; headful और headless mode उसी browser code path का उपयोग करते हैं। अलग पुराना headless mode chrome-headless-shell के रूप में उपलब्ध है और headless: 'shell' से चुना जाता है।
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
दस्तावेज़ में सूचीबद्ध एक मौजूदा mapping Puppeteer v25.12.0 के लिए Chrome for Testing 154.0.8037.57 और Firefox 156.0.1 बताती है। इसे हर installation का version न मानें: आपके environment का वास्तविक version आपके output से तय होगा।
आम समस्याएँ और उनके उपाय
| लक्षण | संभावित वजह | क्या जाँचें या करें |
|---|---|---|
omitBackground: true के बाद भी काला हिस्सा है |
काला रंग page CSS में हो सकता है; transparency option CSS override नहीं है। | प्रभावित element का computed background-color और background-image देखें। जरूरत हो तो सही selector पर capture-specific CSS लगाएँ। |
| Transparent PNG viewer में काली दिखती है | Viewer या अगला processing step transparent pixels को काले background पर दिखा सकता है। | Alpha transparency समझने वाले viewer में खोलें या ज्ञात background पर जाँचें। |
| सिर्फ कुछ pages या एक क्षेत्र काला है | पृष्ठभूमि body के बजाय दूसरे container, overlay या image से आ सकती है। |
Viewport ढकने वाले element की computed styles और page पर लागू styles देखें; नियम उसी selector पर लागू करें। |
| नई मशीन या package update के बाद परिणाम बदला | Puppeteer package, browser version या launch mode अलग हो सकता है। | दोनों environments में package version, browser.version(), launch options, format और screenshot options की तुलना करें। |
| CSS बदलने के बावजूद पुराना रंग दिखता है | Capture उस render state से पहले हो सकता है जिसकी आप अपेक्षा कर रहे हैं, या चुने गए selectors सही element को target नहीं करते। | Navigation के बाद लागू styles और scripts जाँचें; page-विशेष तैयार होने का संकेत मिलने पर capture करें और selector की पुष्टि करें। |
Screenshot setup से बचना हो तो
यह Puppeteer वाला तरीका नहीं है: ScreenshotNeo एक website screenshot API और MCP server है। एक GET request से URL का PNG, JPEG, WebP या PDF capture किया जा सकता है। Cookie banners स्वीकार करने और 60 से अधिक ज्ञात consent platforms, newsletter popups और chat widgets हटाने के विकल्प हैं; इन चरणों को अलग-अलग बंद भी किया जा सकता है। Bot checks/CAPTCHAs, blank pages, timeouts, failed loads और cache hits billed नहीं होते; response में X-Page-Verdict और X-Billed headers बताते हैं कि परिणाम क्या था। AI agents के लिए MCP tools take_screenshot, get_page_info और capture_pdf उपलब्ध हैं। Free plan में बिना card के 1,000 shots प्रति माह हैं; paid plans $5 में 3,000 shots से शुरू होते हैं। API key लें और ScreenshotNeo API docs देखें।
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://example.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://example.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
ScreenshotNeo के बारे में आधिकारिक साइट पर जानें और मुफ्त खाते के लिए sign up करें—बिना card के हर माह 1,000 screenshots।
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →

