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

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Use Ext.get('myDiv') to retrieve a rendered div as an Ext.dom.Element. Use Ext.getDom() when an API needs the native HTMLElement. If “capture” means creating an image, first obtain that native node, then pass it to a DOM-to-canvas library such as html2canvas—or use a browser screenshot service when you need a rendered-page image rather than a DOM reconstruction.

Choose what “capture” means

In Ext JS, capture usually describes one of two different jobs:

  • Find or manipulate a div: obtain an Ext JS wrapper or native DOM node.
  • Render a picture: create a PNG, JPEG, WebP or PDF showing the element or page.

These are separate operations. An Ext JS lookup does not produce an image, and an image library cannot capture an element that has not been rendered yet.

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

Get a div by ID with Ext.get

For a stable HTML ID, call Ext.get without the CSS hash prefix:

#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
var el = Ext.get('myDiv');

Ext.get is an alias for Ext.dom.Element.get. It accepts an ID, an existing HTMLElement, or an existing Ext.dom.Element, and returns an Ext.dom.Element or null when no match exists. The correct argument is 'myDiv'; Ext.get('#myDiv') is incorrect because the method is receiving an ID, not a CSS selector.

var el = Ext.get('myDiv');
if (!el) {
    Ext.raise('The element myDiv is not rendered or does not exist.');
}

// Ext.dom.Element methods are now available.
el.addCls('captured-target');
el.setStyle('outline', '2px solid #4f46e5');

IDs must be unique in the document. If an Ext component generates markup dynamically, give the relevant element an explicit, stable ID or wait until the component has rendered.

Get the native HTMLElement

Ext JS wraps DOM nodes so its element API can provide framework-friendly methods. Browser APIs and many third-party libraries instead require the underlying node. Convert the wrapper with Ext.getDom:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
var el = Ext.get('myDiv');
var domNode = Ext.getDom(el);

If you already know the ID, the ID can be passed directly:

var domNode = Ext.getDom('myDiv');

The element must exist and be rendered when the conversion runs. A component configuration, an xtype, or an element that will be created later is not enough.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
var domNode = Ext.getDom('myDiv');
if (!domNode) {
    console.warn('myDiv is not currently in the DOM.');
    return;
}

console.log(domNode.tagName);       // DIV
console.log(domNode.getBoundingClientRect());

Find a div without an ID

Use a CSS selector from a known root when the markup has no stable ID. The methods differ in scope, cardinality and return type.

Method Selector scope Result Typical use
root.selectNode(selector) Descendants of root First matching Ext.dom.Element Capture or manipulate one card
root.query(selector) Descendants of root HTMLElement[] by default Pass all native nodes to browser code
root.query(selector, false) Descendants of root Ext.dom.Element[] Use Ext methods on every match
root.select(selector, true) Descendants of root Composite of Ext.dom.Element Apply one Ext operation to a collection
var root = Ext.get('panelBody');

var firstCard = root.selectNode('div.card');
var nativeCards = root.query('div.card');
var wrappedCards = root.query('div.card', false);
var cardGroup = root.select('div.card', true);

These selectors are scoped to panelBody, avoiding accidental matches elsewhere in the document. The documented query implementation delegates to querySelectorAll, so use valid CSS selector syntax.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

Wait until Ext JS has rendered the element

A lookup performed before rendering returns null or an empty result. Put capture code in a component lifecycle point where the element is present, such as an afterrender listener, or trigger it from a user action after the view is visible.

Ext.create('Ext.panel.Panel', {
    renderTo: Ext.getBody(),
    title: 'Preview',
    html: '<div id="myDiv" class="card">Ready</div>',
    listeners: {
        afterrender: function (panel) {
            var el = Ext.get('myDiv');
            var node = Ext.getDom(el);
            console.log(node); // The rendered DIV
        }
    }
});

For components that can be destroyed and recreated, do not retain a stale node indefinitely. Resolve the element again after each render, and check el.destroyed or the node’s connection to the document before using it.

Create an image with html2canvas

Once you have a native node, html2canvas can reconstruct an image from the page’s DOM and styles:

Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.
var domNode = Ext.getDom('myDiv');

if (!domNode) {
    throw new Error('myDiv must be rendered before capture.');
}

html2canvas(domNode).then(function (canvas) {
    document.body.appendChild(canvas);
});

The resulting object is a canvas. You can display it, convert it to a data URL, or download it:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
html2canvas(domNode).then(function (canvas) {
    var link = document.createElement('a');
    link.download = 'my-div.png';
    link.href = canvas.toDataURL('image/png');
    link.click();
});

This is a DOM reconstruction, not a pixel-perfect copy of the browser’s compositor. The library documentation cautions that the result may not be 100% accurate to the real representation because it is built from information available in the DOM.

What html2canvas may not reproduce

  • Unsupported CSS properties can be omitted or rendered differently.
  • Images loaded from another origin need appropriate same-origin access or a proxy.
  • A canvas containing disallowed cross-origin pixels becomes tainted, preventing operations such as reading its data.
  • Browser plugins are not rendered.
  • Cross-origin iframes cannot be read because of browser security restrictions.

For predictable output, serve assets with appropriate CORS headers, avoid inaccessible iframe content, and test the exact browser and page state your users will capture.

Capture only the visible element or its full content

A node screenshot normally reflects the node’s rendered box. A scrollable panel may therefore capture only its viewport rather than every row hidden below the scroll position. Before capture, decide whether you need the visible state or the full content.

  • Visible state: capture the node as rendered and preserve its current scroll position.
  • All content: temporarily expand the element, remove clipping, or capture a dedicated full-page rendering; restore the original styles afterward.
var el = Ext.get('myDiv');
var node = Ext.getDom(el);
var oldHeight = node.style.height;
var oldOverflow = node.style.overflow;

node.style.height = 'auto';
node.style.overflow = 'visible';

html2canvas(node).then(function (canvas) {
    node.style.height = oldHeight;
    node.style.overflow = oldOverflow;
    document.body.appendChild(canvas);
});

Expanding a layout can change wrapping, lazy-loaded content and component measurements. If exact visual state matters, capture first after fonts, images and Ext layouts have finished loading.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

Do-it-yourself checklist

  1. Give the target div a unique ID, or identify a stable root and CSS selector.
  2. Wait for the Ext component’s render lifecycle or a user action after the view is visible.
  3. Use Ext.get('id') for an Ext wrapper; omit #.
  4. Use Ext.getDom() when a browser or image library needs an HTMLElement.
  5. Choose selectNode, query or select according to first/all and wrapper/native requirements.
  6. For an image, pass the native node to html2canvas and handle the returned promise.
  7. Check cross-origin images, iframes, CSS support and scroll dimensions before relying on the result.

Or skip the browser setup

When the target is a public URL and you need a browser-rendered screenshot or PDF, ScreenshotNeo makes the capture a single HTTP request. It accepts consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups and chat widgets before the shot; each cleanup step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and response headers identify the page verdict and billing status.

Its API supports full-page capture with lazy images loaded, CSS-selector element capture, dark mode, device presets, custom viewports, retina scale, PDF paper and page options, custom CSS and JavaScript, clicks, selector or network-idle waits, request and resource blocking, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, configurable caching, signed image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, usage reporting and an OpenAPI specification. An MCP server provides take_screenshot, get_page_info and capture_pdf tools for Claude, Cursor and other MCP clients.

Use the same URL you would open in a browser (replace https://stripe.com with your Ext JS application’s address):

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

See the parameter reference in the ScreenshotNeo documentation. A free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Python and Node.js alternatives

The same endpoint works from application code:

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot failed: ${res.status}`);
const fs = await import('node:fs/promises');
await fs.writeFile('shot.webp', Buffer.from(await res.arrayBuffer()));

Troubleshooting

Ext.get returns null

The ID may be wrong, the element may not be rendered yet, or the component may have been destroyed. Verify the exact ID in the live DOM, move the call to afterrender or a later event, and resolve the node again after component recreation.

Ext.get('#myDiv') does not work

Ext.get expects an ID without #. Use Ext.get('myDiv'). Reserve #myDiv for selector methods such as query or selectNode.

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

The selector finds the wrong element

Scope it to a root component: Ext.get('panelBody').selectNode('div.card'). Prefer a unique class, data attribute or ID over a broad selector such as div.

The canvas is blank or missing images

Check that the node is visible, images and fonts have loaded, and external images permit cross-origin use or are served through a proxy. Cross-origin iframes and plugins cannot be read by a normal page script.

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

The screenshot differs from the browser

That is an expected limitation of DOM reconstruction. Unsupported CSS, animations, web fonts, transforms and scroll clipping can alter the result. Freeze animations, wait for layout completion and compare the output in the browser you support.

A remote screenshot reports a bot check or timeout

Inspect the service’s page-verdict and billing headers, then adjust waits, headers, cookies, user agent or resource blocking. ScreenshotNeo does not bill bot checks, blank pages, timeouts or failed loads.

Quick decision table

Need Use
One existing div as an Ext wrapper Ext.get('id')
Native DOM node Ext.getDom('id') or Ext.getDom(el)
First descendant matching a selector root.selectNode(selector)
All matching native nodes root.query(selector)
All matching Ext wrappers root.query(selector, false)
Local DOM-based image html2canvas(domNode)
Remote browser screenshot, PDF, cleanup and automation ScreenshotNeo API or MCP server

Frequently Asked Questions

Can I pass an Ext.dom.Element directly to html2canvas?

Convert it first with Ext.getDom(el), then pass the returned HTMLElement to html2canvas.

Does Ext.get search by CSS selector?

No. Ext.get takes an ID, HTMLElement or Ext.dom.Element. Use query, selectNode or select for CSS selectors.

Free tools Windows power users keep installed

One-click scans. No signup required.

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

Why is my captured panel shorter than its content?

A scrollable element is captured in its rendered viewport. Temporarily expand it or use a full-page capture method when hidden content must be included.

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.