1

I'm using Kantu Browser Automation on Chrome.

Imagine I have the following random website:

https://www.100lenders.com/index.php

Then I want to check whether the select element corresponding to: My Loan Amount on the top right area has 49 options or not?

Check top right panel preview here.

For that I have so far the following JSON:

{
  "CreationDate": "2018-10-22",
  "Commands": [
    {
      "Command": "open",
      "Target": "https://www.100lenders.com/index.php",
      "Value": ""
    },
    {
      "Command": "select",
      "Target": "id=loanSelect",
      "Value": "label=$700"
    },
    {
      "Command": "storeEval",
      "Target": "document.querySelectorAll('#loanSelect option').length",
      "Value": "count"
    },
    {
      "Command": "echo",
      "Target": "${count}",
      "Value": ""
    }
  ]
}

which actually outputs: 49 as you can see on the log below:

[status]
Playing macro 100lenders.com
[info]
Executing:  | open | https://www.100lenders.com/index.php |  | 
[info]
Executing:  | select | id=loanSelect | label=$700 | 
[info]
Executing:  | storeEval | document.querySelectorAll('#loanSelect option').length | count | 
[info]
Executing:  | echo | ${count} |  | 
[echo]
49
[info]
Macro completed (Runtime 4.00s)

My goal is that if for some reason the number is other than 49, then highlight that with a non-green entry.

Any idea on how to do this?

Thanks!

Viewsonic
  • 827
  • 2
  • 15
  • 34

0 Answers0