コンテンツにスキップ
ログイン サインアップ

CSSを待機

wait_for_css にCSSセレクタを渡すと、APIはそのページを返す前に、その要素が出現するまで最大10秒間待機します。セレクタが一度も出現しなかった場合、リクエストは失敗し、課金されません。

GET https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=<TARGET_URL>&wait_for_css=<CSS_SELECTOR>&render_js=1
ParameterTypeRequiredDescription
api_keystringyesWeb Scraping APIキー
urlstringyes取得対象のURL
wait_for_cssstringyes待機対象のCSSセレクタ。
render_jsintegeryes1 である必要があります。
timeoutintegerno待機する最大時間(ミリ秒)。デフォルトは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>