Screenshot Capture | Python
Learn how to take a screenshot of a page when scraping with ScraperAPI in Python. Capture page images using screenshot=true. Ideal for monitoring and documentation.
Our Java Script solution now gives you the ability to take a screenshot of the target page through the use of the parameter screenshot=true
. This parameter automatically enables JS rendering to get the full page content, before taking a screenshot.
After we serve the response, you can find the screenshot URL in the sa-screenshot
response header. The screenshot format is PNG
:

API REQUEST
import requests
payload = {'api_key': 'APIKEY', 'screenshot': 'true', 'url':'https://example.com/'}
r = requests.get('https://api.scraperapi.com', params=payload)
print(r.text)
print("\nResponse Headers:")
for key, value in r.headers.items():
print(f"{key}: {value}")
ASYNC REQUEST
import requests
url = 'https://async.scraperapi.com/batchjobs'
data = {
'apiKey': 'API_KEY',
'url': 'https://example.com/',
'apiParams': {
'screenshot': 'true'
}
}
r = requests.post(url=url, json=data)
print(r.text)
PROXY MODE - COMING SOON!
Last updated
Was this helpful?