Element Targeting Screenshots
Capture specific elements on any webpage using CSS selectors. Screenshot only the header, a product card, a chart, or any HTML element you need.
How Element Targeting Works
Use the element parameter to specify a CSS selector that identifies the element you want to capture. GetScreenshot will find that element and return a screenshot cropped exactly to its boundaries.
This is perfect when you only need a portion of a webpage, like a pricing table, navigation menu, hero section, or data visualization.
API Parameter
element={CSS selector}
Pass any valid CSS selector. Supports IDs (#hero), classes (.pricing-card), tags (header), and complex selectors. URL-encode the value. If the selector matches nothing on the page, the request fails with HTTP 500, so test the selector on the live page first.
Example: Capture Product Card
https://api.rasterwise.com/v1/get-screenshot
?apikey=YOUR_API_KEY
&url=https://store.example.com
&element=.product-card:first-child
Supported Selector Types
# By ID
element=#main-content
# By class
element=.hero-section
# By tag
element=article
# Complex selector
element=div[data-testid="chart"]
Common Use Cases
Element targeting is useful for many scenarios
E-commerce Products
Capture individual product cards, pricing tables, or buy buttons for marketing materials and competitive analysis.
Learn moreCharts & Dashboards
Extract specific charts, graphs, or KPI widgets from analytics dashboards for reports and presentations.
Learn moreSocial Media Posts
Capture specific tweets, posts, or comments for embedding in articles or monitoring mentions.
Learn moreUI Components
Document specific UI components like navigation bars, footers, or form elements for design systems.
Pricing Tables
Capture competitor pricing tables or your own for comparison pages and sales materials.
Learn moreNews & Articles
Capture specific article sections, headlines, or quotes for media monitoring and content curation.
Combine with Other Features
Element targeting works with other GetScreenshot capabilities
Custom CSS
Style the element before capturing it. Add borders, change backgrounds, or modify layout.
PDF Generation
Need the whole page as a document instead? pdf=true returns an A4 PDF of the full page.
Viewport Control
Set the viewport size to ensure responsive elements render at the right breakpoint.
Webhooks
Receive element screenshots via webhook for automated processing workflows.
Ready to Capture Specific Elements?
Get started with GetScreenshot's element targeting. Available on all plans.