Search for Text in a webpage and then stop then play sound?

Hi All , trying to get what a thought would be strait forward project to work. Any help would be gratefully received .Trying to search for a word once found, stop and play a sound .

Searching text can be done with different methods:

(1) Easiest: If text is in page source: => Use SourceSearch command. See also How to sourceSearch and sourceExtract with case-insensitve text - #4 by admin

If text is not directly in page source (e.g. due to frames, Javascript, Ajax and other modern page elements):

  • (2) automate the browser text search by simulating “Ctrl+F” with XType

  • (3) Or: Use OCRSearch. If this is a large web page and you want to also OCR the text below the fold then add visionLimitSearchArea | full before the OCR search command.

1 Like

Search text:

If text is in page source: => Use SourceSearch command. See also How to sourceSearch and sourceExtract with case-insensitve text - #4 by admin

If text is not directly in page source (e.g. due to frames, Javascript, Ajax and other modern page elements):

  • automate the browser text search by simulating “Ctrl+F” with XType and RPA desktop automation

  • Or: Use OCRSearch. If this is a large web page and you want to also OCR the text below the fold then add visionLimitSearchArea | full before the OCR search command.

Demo macro for the OCR method:

{
  "Name": "page text search",
  "CreationDate": "2021-6-21",
  "Commands": [
    {
      "Command": "open",
      "Target": "https://ui.vision",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "visionLimitSearchArea",
      "Target": "full",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "2",
      "Value": "!ocrengine",
      "Description": ""
    },
    {
      "Command": "OCRSearch",
      "Target": "data-driven",
      "Value": "a",
      "Description": ""
    },
    {
      "Command": "if_v2",
      "Target": "${a} >= 0",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "echo",
      "Target": "found ${a}  times",
      "Value": "green",
      "Description": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": "",
      "Description": ""
    }
  ]
}

For playing a sound see play sound with RPA