How If condition working


#1

hi I need help,

i have 2 wep pages, i want find/read a particular text, if is available then loop otherswise stop the loop.

how to solve this…


#2

Here is a quick demo. It uses storeText to extract the current time, and then loops until the seconds are bigger than 30 (which I use as example of “particular text”).

{
  "CreationDate": "2018-11-4",
  "Commands": [
    {
      "Command": "open",
      "Target": "https://www.timeanddate.com/worldclock/usa/new-york-state",
      "Value": ""
    },
    {
      "Command": "label",
      "Target": "waitfortext",
      "Value": ""
    },
    {
      "Command": "storeText",
      "Target": "id=ct",
      "Value": "time"
    },
    {
      "Command": "storeEval",
      "Target": "storedVars['time'].substr(6, 2);",
      "Value": "sec"
    },
    {
      "Command": "echo",
      "Target": "time=${time} => seconds=${sec}",
      "Value": ""
    },
    {
      "Command": "gotoIf",
      "Target": "${sec} < 30",
      "Value": "waitfortext"
    },
    {
      "Command": "echo",
      "Target": "SECONDS is more than 30! (wait for text is done)",
      "Value": "green"
    }
  ]
}