Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk2 min

Selenium आणि ChromeDriver वापरून वेबसाइटचा screenshot कसा घ्यायचा (मराठीत)

Selenium Python मधून Chromeचा PNG screenshot जतन करण्याची पद्धत, driver व्यवस्थापन, dynamic content waits आणि troubleshooting जाणून घ्या.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Python आणि Selenium वापरून Chrome मध्ये पेज उघडा, सध्याच्या browser window चा PNG screenshot जतन करा आणि browser session बंद करा. Selenium 4.6 किंवा त्यानंतरच्या आवृत्तीत Selenium Manager बहुतांश स्थानिक सेटअपमध्ये driver मिळवू शकतो; ChromeDriver स्वतंत्रपणे डाउनलोड करणे प्रत्येक वेळी आवश्यक नसते.

Python मधून screenshot कसा घ्यायचा?

आधी Selenium स्थापित करा:

python -m pip install selenium

खालील उदाहरण https://example.com उघडते, screenshot.png म्हणून सध्याच्या window चा screenshot जतन करते, यशस्वी झाल्याची खात्री करते आणि काम संपल्यावर Chrome बंद करते.

from selenium import webdriver

url = "https://example.com"
driver = webdriver.Chrome()
try:
    driver.get(url)
    saved = driver.save_screenshot("screenshot.png")
    if not saved:
        raise OSError("Screenshot could not be saved")
finally:
    driver.quit()

फाइल चालवण्यासाठी, उदाहरणार्थ, कोड capture.py मध्ये जतन करा आणि चालवा:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#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.
python capture.py

कामकाजाच्या सध्याच्या directory मध्ये screenshot.png तयार होईल. save_screenshot() ही Python API PNG साठी आहे आणि I/O त्रुटी आली तर False परत करते; त्यामुळे विस्तार .png ठेवा आणि निकाल तपासा. finally मधील driver.quit() त्रुटी आली तरी WebDriver session बंद करण्याची खात्री देते.

हा पूर्ण webpage चा screenshot असतो का?

नाही, या पद्धतीचा स्पष्ट अर्थ सध्याच्या browser window किंवा browsing context चा screenshot असा आहे. तो आपोआप संपूर्ण लांबीचा webpage पकडतो, अशी सार्वत्रिक Chrome हमी Seleniumच्या या API वर्णनातून स्थापित होत नाही. संपूर्ण पान आवश्यक असल्यास वापरणार असलेली पद्धत तुमच्या Selenium आणि Chrome आवृत्त्यांवर तपासा; अपेक्षित पूर्ण लांबी मिळते का हे प्रत्यक्ष पडताळा.

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.

फक्त एखादे कार्ड, चार्ट किंवा इतर एक घटक हवा असल्यास window ऐवजी त्या element वर screenshot method वापरणे योग्य ठरू शकते. Seleniumच्या WebDriver दस्तऐवजात element screenshot चा पर्यायही दाखवला आहे. Selenium: Working with windows and tabs

ChromeDriver सेटअप: डाउनलोड करावा लागतो का?

नवीन Selenium मध्ये आधी webdriver.Chrome() वापरून पाहा. Selenium Manager driver व्यवस्थापन स्वयंचलित करू शकतो; Seleniumच्या मार्गदर्शनानुसार ही सुविधा Selenium 4.6 पासून उपलब्ध आहे. त्यामुळे प्रत्येक वापरकर्त्याने ChromeDriver स्वतः डाउनलोड करून PATH मध्ये ठेवणे बंधनकारक नाही.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.

पर्यावरणाने driver शोधला नाही किंवा तुम्हाला आवृत्ती व स्थान स्वतः नियंत्रित करायचे असल्यास manual पर्याय वापरा: driver PATH मध्ये ठेवा किंवा Python मधील Service object ला driver चा path द्या. अचूक स्थापना परिस्थितीनुसार बदलू शकते. Selenium: Installing browser drivers

Chrome आणि ChromeDriver आवृत्त्या

Selenium Project च्या Chrome-specific मार्गदर्शकात म्हटले आहे: “By default, Selenium 4 is compatible with Chrome v75 and greater. Note that the version of the Chrome browser and the version of chromedriver must match the major version.” हे Seleniumचे दस्तऐवजीकरणातील compatibility विधान आहे; आवृत्त्या बदलू शकतात, त्यामुळे नवीन सेटअपसाठी Chrome specific functionality पान तपासा.

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

JavaScript content दिसेपर्यंत कसे थांबायचे?

driver.get(url) नंतर navigation साधारणपणे document ची readyState complete होईपर्यंत थांबते. पण त्यानंतरही JavaScript पेज बदलू शकते—उदाहरणार्थ, API response आल्यावर सूची दिसणे किंवा popup उघडणे. त्यामुळे navigation पूर्ण झाली म्हणजे screenshot साठी आवश्यक प्रत्येक घटक तयार आहे, असे समजू नका.

ज्या विशिष्ट घटकाचा screenshot हवा आहे, तो दिसेपर्यंत explicit wait वापरा. मनाने मोठा sleep देण्यापेक्षा अपेक्षित condition तपासणे अधिक नेमके असते. Implicit आणि explicit waits एकत्र मिसळल्यास timeout अनपेक्षित होऊ शकतो, अशी Seleniumची सूचना आहे. Selenium: Waiting Strategies

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait

url = "https://example.com"
driver = webdriver.Chrome()
try:
    driver.get(url)
    WebDriverWait(driver, 15).until(
        EC.visibility_of_element_located((By.CSS_SELECTOR, "main"))
    )
    if not driver.save_screenshot("screenshot.png"):
        raise OSError("Screenshot could not be saved")
finally:
    driver.quit()

येथे main हा फक्त उदाहरणातील selector आहे; लक्ष्य पेजवर प्रत्यक्ष दिसणाऱ्या घटकाचा CSS selector वापरा. घटक 15 सेकंदांत दिसला नाही, तर wait timeout होईल.

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

सामान्य त्रुटी आणि उपाय

  • Driver सापडत नाही: Selenium Manager साठी Selenium अद्ययावत करून पुन्हा प्रयत्न करा. तरीही त्रुटी राहिल्यास Selenium driver-installation मार्गदर्शकानुसार PATH किंवा Service path तपासा.
  • Chrome सुरू होत नाही किंवा session तयार होत नाही: Chrome आणि ChromeDriver यांच्या major आवृत्त्या जुळतात का तपासा. Seleniumची Chrome compatibility सूचना आवृत्ती-संवेदनशील आहे.
  • Screenshot मध्ये अपेक्षित मजकूर किंवा घटक नाही: navigation संपल्यावरही JavaScript काम करत असू शकते. त्या घटकाची visibility किंवा दुसरी योग्य condition explicit wait ने तपासा.
  • फाइल तयार झाली नाही: प्रक्रिया कोणत्या directory मधून चालली ते तपासा, त्या ठिकाणी लिहिण्याची परवानगी आहे का पाहा, आणि save_screenshot() ने False दिले का तपासा. गरज असल्यास पूर्ण output path द्या.
  • चित्रात फक्त viewport दिसतो: save_screenshot() ला पूर्ण-page capture समजू नका. अपेक्षित scope साठी निवडलेली पद्धत तुमच्या Chrome आणि Selenium आवृत्त्यांसोबत पडताळा.
  • Wait वेळ संपतो: selector लक्ष्य पेजवर योग्य आहे का आणि घटक खरोखर visible होतो का पाहा. आवश्यक असल्यास timeout वाढवा; पण चुकीचा selector लपवण्यासाठी अनिश्चित काळ थांबू नका.

Or skip the browser setup

Seleniumने स्थानिक Chrome उभारण्याऐवजी ScreenshotNeo च्या screenshot API ला एक GET request देऊन प्रतिमा मिळवता येते. खाली cURL उदाहरण आहे; API पर्याय आणि parameter तपशील ScreenshotNeo दस्तऐवजांत पाहा.

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

ScreenshotNeo capture आधी cookie/consent banners स्वीकारते आणि 60 पेक्षा जास्त ज्ञात consent platforms, newsletter popups व chat widgets काढते; हे प्रत्येक टप्पे बंद करता येतात. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads आणि cache hits साठी शुल्क घेतले जात नाही, бөгөөд response headers मध्ये page verdict व billing माहिती असते. AI agent ашиглахад MCP server मधэх take_screenshot, get_page_info आणि capture_pdf tools उपलब्ध आहेत. Free plan मध्ये दरमहा 1,000 screenshots, card न देता; paid plans 3,000 screenshots साठी $5 पासून सुरू होतात.

ScreenshotNeo वर मोफत खाते तयार करा — दरमहा 1,000 screenshots, कार्डची गरज नाही.

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

Frequently Asked Questions

Screenshot फाइल नेहमी PNG असते का?

या लेखातील Selenium Python पद्धत PNG जतन करते; फाइलला .png विस्तार द्या.

फक्त एका HTML घटकाचा screenshot घेता येतो का?

होय. Seleniumच्या समर्थित bindings मध्ये WebElement screenshot method उपलब्ध आहे; तो संपूर्ण window ऐवजी निवडलेल्या घटकासाठी वापरा.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.