Skip to content
Login Sign up

Waiting for CSS

Pass a CSS selector to wait_for_css and the API waits up to 10 seconds for that element to appear before returning the page. If the selector never shows up, the request fails and is not charged.

GET https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=<TARGET_URL>&wait_for_css=<CSS_SELECTOR>&render_js=1
ParameterTypeRequiredDescription
api_keystringyesYour Web Scraping API key
urlstringyesTarget URL to fetch
wait_for_cssstringyesCSS selector to wait for.
render_jsintegeryesMust be 1.
timeoutintegernoMax time in milliseconds to wait. Defaults to 10000.
Terminal window
curl "https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=https://example.com&wait_for_css=.firstHeading&render_js=1"
<!doctype html>
<html>
<head>
<title>Example Domain</title>
</head>
<body>
<div>
<h1>Example Domain</h1>
<p>This domain is for use in illustrative examples in documents.</p>
</div>
</body>
</html>