← Back to Page domain
Page.searchInResource
Searches for given string in resource content.
Domain: Page
experimental
Parameters
| Name | Type | Description |
frameId | FrameId | Frame id for resource to search in. |
url | string | URL of the resource to search in. |
query | string | String to search for. |
caseSensitive (optional) | boolean | If true, search is case sensitive. |
isRegex (optional) | boolean | If true, treats string parameter as regex. |
Returns
| Name | Type | Description |
result | array | List of search matches. |
Example Request
{
"id": 1,
"method": "Page.searchInResource",
"params": {
"frameId": "ABC123DEF456",
"url": "https://example.com",
"query": "query-value"
}
}
Example Response
{
"id": 1,
"result": {
"result": {
"type": "string",
"value": "Example Domain"
}
}
}
Usage in Node.js
const result = await send('Page.searchInResource', {"frameId": "ABC123DEF456", "url": "https://example.com", "query": "query-value"});
console.log(result);
// {"result": {"type": "string", "value": "Example Domain"}}