defaults:
width: 1280
height: 800
timeout: 30
wait: 2
retina: false
user_agent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36"
output_dir: "screenshots"
headers:
"Accept-Language": "en-US,en;q=0.9"
cookies:
- name: "session"
value: "example_session_id"
domain: ".example.com"
screenshots:
- url: "https://example.com"
output: "example-homepage.png"
- url: "https://github.com"
output: "github-desktop.png"
width: 1920
height: 1080
- url: "https://github.com"
output: "github-header.png"
selector: ".Header"
- url: "https://example.com"
output: "example-mobile.png"
width: 375
height: 812
- url: "https://example.com"
output: "example-interactive.png"
javascript: |
// Click a button or interact with the page
document.querySelector('button')?.click();
// Change some styling
document.body.style.backgroundColor = '#f0f0f0';
- url: "https://httpbin.org/delay/2"
output: "httpbin-delayed.png"
wait_for: "pre"
timeout: 10
- url: "https://picsum.photos/1200/800"
output: "random-image.jpg"
quality: 95
- url: "https://example.com"
output: "example-retina.png"
retina: true
- url: "https://example.com"
output: "example-page.pdf"
- url: "https://httpbin.org/basic-auth/user/pass"
output: "authenticated.png"
auth:
username: "user"
password: "pass"
headers:
"X-Custom-Header": "webshot-example"
- url: "https://httpbin.org/user-agent"
output: "user-agent-test.png"
wait: 3
user_agent: "WebshotBot/1.0"
- url: "https://github.com/explore"
output: "github-explore-trending.png"
selector: ".Box:first-child"
wait_for: ".Box"
- url: "https://github.com/features"
output: "github-features-full.png"
height: 2000
- url: "https://example.com"
output: "example-modified.png"
javascript: |
// Remove unwanted elements
document.querySelectorAll('.advertisement, .popup').forEach(el => el.remove());
// Modify content
const title = document.querySelector('h1');
if (title) {
title.textContent = 'Modified by WebShot';
title.style.color = 'red';
}
// Scroll to specific position
window.scrollTo(0, 500);
// Wait for any animations to complete
await new Promise(resolve => setTimeout(resolve, 1000));
- url: "https://example.com"
output: "example-personalized.png"
cookies:
- name: "user_preference"
value: "dark_theme"
path: "/"
- name: "language"
value: "en"
path: "/"