← Back to DOM domain

DOM.getSearchResults

Returns search results from given `fromIndex` to given `toIndex` from the search with the given identifier.

Domain: DOM experimental

Parameters

NameTypeDescription
searchIdstringUnique search session identifier.
fromIndexintegerStart index of the search result to be returned.
toIndexintegerEnd index of the search result to be returned.

Returns

NameTypeDescription
nodeIdsarrayIds of the search result nodes.

Example Request

{
  "id": 1,
  "method": "DOM.getSearchResults",
  "params": {
    "searchId": "searchId-value",
    "fromIndex": 1,
    "toIndex": 1
  }
}

Example Response

{
  "id": 1,
  "result": {
    "nodeIds": [
      3,
      4,
      5
    ]
  }
}

Usage in Node.js

const result = await send('DOM.getSearchResults', {"searchId": "searchId-value", "fromIndex": 1, "toIndex": 1});
console.log(result);
// {"nodeIds": [3, 4, 5]}