Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

अगर Puppeteer के पूरे पेज वाले screenshot में sticky header कई बार दिख रहा है, तो पहले पता करें कि screenshot एक बार में लिया जा रहा है या पेज को scroll करके viewport images जोड़ी जा रही हैं। Scroll-and-stitch capture में हर हिस्से में दिखता sticky header दोहर सकता है। Live viewport जैसा दृश्य चाहिए तो सामान्य viewport screenshot लें; एक स्थिर full-document image चाहिए तो capture के दौरान sticky positioning को सावधानी से बदलें और परिणाम जाँचें।

पहले पहचानें: viewport, native full-page या scroll-and-stitch?

Puppeteer का fullPage: true पूरे पेज का screenshot लेने के लिए है; दस्तावेज़ यह नहीं कहता कि यह पेज की CSS positioning को बदल देता है। इसलिए full-page विकल्प अपने-आप sticky header को सामान्य document flow में लौटाने की गारंटी नहीं देता। विकल्प का अर्थ और capture scope Puppeteer ScreenshotOptions दस्तावेज़ में देखें।

आपको क्या चाहिए उपयुक्त तरीका ध्यान देने योग्य बात
वर्तमान scroll position पर visitor को जो दिखता है सामान्य viewport screenshot केवल दिखाई दे रहा viewport capture होता है।
पूरे document की एक image fullPage: true native screenshot अपनी Puppeteer और Chromium versions पर sticky/fixed rendering जाँचें।
कई viewport images से बनी full image Scroll-and-stitch capture, साथ में capture-time sticky handling Handling न हो तो sticky या fixed element अलग-अलग हिस्सों में दोहर सकता है; CSS override layout बदल सकता है।

puppeteer-full-page-screenshot पैकेज भी चेतावनी देता है कि scroll करके screenshots इकट्ठा करने पर sticky elements कई बार आ सकते हैं; वह custom styles से उन्हें reset करने की सलाह देता है। पैकेज दस्तावेज़

Sticky header के scrolling context की जाँच करें

सबसे पहले Puppeteer और Chromium के versions, screenshot call, तथा इस्तेमाल हो रहे किसी wrapper या helper को दर्ज करें। फिर यह पता करें कि header viewport screenshot में भी दोहर रहा है या सिर्फ full-document output में। अगर screenshot helper पेज scroll करके viewport captures जोड़ता है, तो कई बार दिखना उस तरीके का स्वाभाविक नतीजा हो सकता है।

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

CSS में position: sticky वाला element अपने निकटतम ऐसे ancestor के संदर्भ में चिपकता है जिसमें scrolling mechanism हो। यह ancestor overflow: hidden, scroll, auto या overlay के कारण बन सकता है—भले ही वही element वास्तव में scroll होता हुआ दिखाई न दे। Sticky व्यवहार के लिए उस axis पर top जैसा non-auto inset भी जरूरी है। अपने header और ancestors के computed styles जाँचने के लिए [MDN का position संदर्भ](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/position) देखें।

const headerInfo = await page.evaluate(() => {
  const header = document.querySelector('header');
  if (!header) return { found: false };

  const ancestors = [];
  for (let el = header; el; el = el.parentElement) {
    const style = getComputedStyle(el);
    ancestors.push({
      tag: el.tagName,
      id: el.id,
      position: style.position,
      top: style.top,
      overflow: style.overflow,
      overflowY: style.overflowY
    });
  }
  return { found: true, header: ancestors[0], ancestors };
});
console.log(headerInfo);

यह उदाहरण पहले <header> को देखता है; साइट का markup अलग हो तो selector को header के वास्तविक CSS selector से बदलें। परिणाम से header की position और top के साथ हर ancestor के overflow values मिलेंगे।

एक static full-page image के लिए capture-time override

अगर output कई scrolled viewport images को जोड़कर बनता है, तो screenshot के लिए अस्थायी CSS लगाकर sticky header को सामान्य flow में लौटाने की कोशिश करें। इससे वह हर segment में viewport से चिपका नहीं रहेगा। नीचे का उदाहरण header selector मानता है; अपने पेज के वास्तविक selector से इसे बदलें।

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://example.com', { waitUntil: 'networkidle2' });

  await page.addStyleTag({
    content: `
      header {
        position: static !important;
        top: auto !important;
      }
    `
  });

  await page.screenshot({ path: 'full-page.png', fullPage: true });
  await browser.close();
})();

यह capture-only बदलाव है: screenshot के लिए पेज की rendering बदलती है, इसलिए इसे live visitor के दृश्य के बराबर न मानें। Output में header की जगह, content overlap और नीचे के sections जाँचें। केवल visibility: hidden करना पर्याप्त नहीं हो सकता—element की positioning के कारण खाली जगह या गलत layout बच सकता है। जरूरत हो तो selector को अधिक सीमित करें या CSS को अपने layout के अनुसार समायोजित करें।

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

captureBeyondViewport को केवल नियंत्रित परीक्षण में बदलें

अप्रैल 2021 के Puppeteer issue #7043 में एक रिपोर्टर ने बताया कि captureBeyondViewport: false से उसके sticky top menu का मामला ठीक हुआ। यह एक विशेष configuration की रिपोर्ट है, सार्वभौमिक समाधान नहीं। मौजूदा API दस्तावेज़ इस option को viewport से आगे capture करने के दायरे के रूप में परिभाषित करते हैं; sticky header के लिए guaranteed fix के रूप में नहीं।

दस्तावेज़ के अनुसार, जब clip न हो तो इसका default false है और clip होने पर true। अपने installed Puppeteer version में विकल्प का व्यवहार जाँचें और बाकी screenshot options समान रखते हुए A/B परीक्षण करें:

#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • 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.
await page.screenshot({
  path: 'capture-beyond-viewport-false.png',
  fullPage: true,
  captureBeyondViewport: false
});

एक पुराने Puppeteer maintainer discussion में viewport resize करने और scroll-and-stitch करने के trade-offs समझाए गए हैं: viewport resize से vh-आधारित layout और sticky/fixed positioning प्रभावित हो सकती है; stitching में ऐसे elements दोहर सकते हैं और अतिरिक्त काम लग सकता है। यह 2019 की चर्चा है, हर मौजूदा implementation के बारे में दावा नहीं।

लक्षण और उनके व्यावहारिक समाधान

  • Header केवल stitched full-page output में दोहरता है: stitching helper में capture-time sticky handling लगाएँ या एक native full-page capture आजमाएँ।
  • Viewport screenshot में भी एक से अधिक header दिखते हैं: duplicate DOM elements, app rendering और screenshot selector जाँचें; यह जरूरी नहीं कि Puppeteer stitching का मामला हो।
  • Header गायब है, लेकिन ऊपर खाली जगह बची है: सिर्फ visibility छिपाने के बजाय positioning और normal-flow layout जाँचें।
  • Override से content खिसक गया या overlap हुआ: override को अधिक सटीक selector तक सीमित करें, संबंधित layout की जाँच करें और फिर screenshot लें।
  • captureBeyondViewport बदलने से फर्क नहीं पड़ा: इसे sticky fix मानकर निर्भर न रहें; capture method, CSS और scrolling ancestors पर लौटें।

Or skip the browser setup

अगर आपको केवल वेबसाइट की image या PDF चाहिए, तो ScreenshotNeo एक request से capture करता है। Cookie banners, popups और chat widgets हटाने के विकल्प हैं; bot checks, blank pages और failed loads कभी billed नहीं होते। AI agents के लिए MCP server में screenshot लेने का tool भी है। Free plan में बिना card के हर महीने 1,000 screenshots हैं; paid plans $5 में 3,000 से शुरू होते हैं।

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

उदाहरण—cURL से WebP screenshot:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

API parameters और capture विकल्पों के लिए ScreenshotNeo API documentation देखें। शुरुआत के लिए free account बनाएं—1,000 screenshots प्रति माह, बिना card के।

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Frequently Asked Questions

क्या यह समस्या खास तौर पर Indian websites में होती है?

उपलब्ध तकनीकी संदर्भ सामान्य Puppeteer और CSS व्यवहार बताते हैं; वे इसे India-specific browser या website behavior नहीं ठहराते।

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 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.

क्या fullPage: true sticky header को reset करता है?

Puppeteer का दस्तावेज़ इसे full-page screenshot के रूप में परिभाषित करता है, CSS positioning बदलने के रूप में नहीं।

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 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.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • 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
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • 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.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.