Some help here, please! Error Ignore

Hey!
I’m new here and need some help for this amazing tool.

I need to ignore the error if the “Target” of the URL doesn’t exist. In this extract of the macro, if the “link=CSV” doesn’t exist, It need to pass the next command:

In this example, the macro open the url, go to the target “CSV” and it download the file. There’s 2 cases:

{
  "Command": "open",
  "Target": "http://store.intcomex.com/es-XCL/Products/ByCategory/cac.cable?r=True",
  "Value": ""
},
{
  "Command": "waitForPageToLoad",
  "Target": "",
  "Value": "1500ms"
},
{
  "Command": "click",
  "Target": "link=CSV",
  "Value": ""
},

{
“Command”: “open”,
“Target”: “http://store.intcomex.com/es-XCL/Products/ByCategory/cac.pad?r=True”,
“Value”: “”
},
{
“Command”: “waitForPageToLoad”,
“Target”: “”,
“Value”: “1500ms”
},
{
“Command”: “click”,
“Target”: “link=CSV”,
“Value”: “”
},

I really appreciate your help

Thanks!

You are already on the right track with !errorignore. To make it work add
store | true | !errorignore
before this command, and
store | false | !errorignore
after it to switch back to normal mode (if needed).

If you want, you can also reduce the time that Kantu waits for the link to appear. For this use !timeout_wait:

store | 5 | !timeout_wait

(Now Kantu waits only 5 seconds)

1 Like

Thank you very much for your time!

I will try this in a moment, but first, sometimes the CSV link doesn’t download nothing and I think this is for the little time this have to the browser get the file.

What do you think about this?

Thanks!

This question I don’t understand… a website link or a screenshot would help.

You can change download file time in kantu options

ulrich , this solution is great. It’s helped me with my project a great amount!

I currently have a list of 31 click actions (calendar dates), most of which are !errorignore. If the date available to click on is the last one, going through each iteration, 1-30 with a !timeout_wait of 0 still takes roughly 5.7 seconds before my date is clicked. Is there any way to make it quicker? Would a loop be better (idk how to do one)?

{
“Command”: “store”,
“Target”: “true”,
“Value”: “!errorignore”
},
{
“Command”: “store”,
“Target”: “0”,
“Value”: “!timeout_wait”
},
{
“Command”: “click”,
“Target”: “link=1”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “link=2”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “link=3”,
“Value”: “”
},

{
  "Command": "click",
  "Target": "link=31",
  "Value": ""
}

]
}

have you tried changing the loading time ? didn’t help?