本文へスキップ
すべてのツール

web_wait_for

Web 自動化 · macOS · Windows

効果: 書き込み. 状態: 条件付き提供.

「条件付き提供」は、バージョン、プラットフォーム、権限、アカウント、設定に依存する可能性を示し、すべての環境で有効という意味ではありません。

macOS

目的

要素がページに表示されるまで(固定のスリープではなくポーリングで)待機し、タイムアウトで終了します。読み込み後にハイドレーションされる SPA ページに使います。`selector`(CSS セレクター。例: "input[name=password]")を優先してください。`condition` は "document.querySelector('...')" の形式も受け付けます。それ以外の JavaScript 条件はページ上で任意のコードを実行し(web_eval と同じ権限)、confirm=true が必要で、渡さない場合は何も実行せずプレビューを返します。LMCP が読み取り専用モードのときは無効です。met:true/false を返します。

必須入力

このプラットフォームのスキーマには必須入力が宣言されていません。任意の選択項目や実行要件が存在する場合があります。

権限と確認

スキーマには明示的な確認パラメータがあります。プレビューを確認し、プラットフォーム契約に従って実操作を承認してください。

英語の正規技術スキーマ — macOS
{
  "properties": {
    "condition": {
      "description": "Alternative to selector: \"document.querySelector('...')\" is accepted as-is; any other JS expression runs arbitrary code on the page (same power as web_eval).",
      "type": "string"
    },
    "confirm": {
      "description": "Must be true to run a `condition` that is arbitrary JavaScript. Without it, returns a preview and runs nothing. Not needed for `selector` or the document.querySelector('...') form.",
      "type": "boolean"
    },
    "selector": {
      "description": "CSS selector to wait for (preferred; treated as data, never executed). e.g. .feed",
      "type": "string"
    },
    "session": {
      "description": "Session name (default 'default').",
      "type": "string"
    },
    "timeout_seconds": {
      "description": "Max seconds to wait (default 15).",
      "type": "integer"
    }
  },
  "required": [],
  "type": "object"
}

ドキュメント例

web_wait_for のドキュメント例です。この例は実行しないでください。表示される引数は架空のデータセットに属します。実際に呼び出す前に実在する識別子を確認し、承認を得てください。

{
  "confirm": false,
  "selector": "h1",
  "session": "demo-browser"
}

Windows

目的

要素が表示されるまで(またはページの条件が満たされるまで)、固定のスリープではなくポーリングで待機し、タイムアウトで終了します。`selector` パラメーターを優先してください。CSS セレクターがデータとして待機されます(例: selector "input[name=password]")。`condition` は、互換性のために文書化された形式 "document.querySelector('SEL')" も受け付けます。それ以外の JavaScript をページ上で評価することもでき、その場合は confirm=true が必要で、渡さない場合は何も実行せずプレビューを返します。met:true/false を返します。

必須入力

このプラットフォームのスキーマには必須入力が宣言されていません。任意の選択項目や実行要件が存在する場合があります。

権限と確認

スキーマには明示的な確認パラメータがあります。プレビューを確認し、プラットフォーム契約に従って実操作を承認してください。

英語の正規技術スキーマ — Windows
{
  "properties": {
    "condition": {
      "description": "Alternative to selector: \"document.querySelector('SEL')\" (compat), or any other JavaScript.",
      "type": "string"
    },
    "confirm": {
      "description": "Must be true to run a `condition` that is arbitrary JavaScript. Without it, returns a preview and runs nothing. Not needed for `selector` or the document.querySelector('SEL') form.",
      "type": "boolean"
    },
    "selector": {
      "description": "CSS selector to wait for (preferred; treated as data, never executed). e.g. .feed, input[name=password]",
      "type": "string"
    },
    "session": {
      "description": "Session name (default 'default').",
      "type": "string"
    },
    "timeout_seconds": {
      "description": "Max seconds to wait (default 15).",
      "type": "integer"
    }
  },
  "required": [],
  "type": "object"
}

ドキュメント例

web_wait_for のドキュメント例です。この例は実行しないでください。表示される引数は架空のデータセットに属します。実際に呼び出す前に実在する識別子を確認し、承認を得てください。

{
  "confirm": false,
  "selector": "h1",
  "session": "demo-browser"
}