Guidance on most efficient code for multiple checks

Hi all,

I designed the following to find something on a page in 3 different ways and write the link to csv if found. I originally tried if-elseIf-else-end and couldn’t wrap my head around it. I continued to read and came up with this solution using gotoIf. My impression is that the code below is overly complicated and a similar effect could’ve been achieved more easily. I would love your expertise on how you would’ve approached this. Thank you!

    {
  "Name": "scrape-3",
  "CreationDate": "2020-6-28",
  "Commands": [
    {
      "Command": "csvRead",
      "Target": "website.csv",
      "Value": ""
    },
    {
      "Command": "open",
      "Target": "${!COL1}",
      "Value": ""
    },
    {
      "Command": "verifyElementPresent",
      "Target": "partialLinktext=donat",
      "Value": ""
    },
    {
      "Command": "gotoIf_v2",
      "Target": "${!LASTCOMMANDOK}",
      "Value": "donsave"
    },
    {
      "Command": "verifyElementPresent",
      "Target": "partialLinktext=contrib",
      "Value": ""
    },
    {
      "Command": "gotoIf_v2",
      "Target": "${!LASTCOMMANDOK}",
      "Value": "consave"
    },
    {
      "Command": "verifyElementPresent",
      "Target": "xpath=//*[contains(@href,'donat')]",
      "Value": ""
    },
    {
      "Command": "gotoIf_v2",
      "Target": "${!LASTCOMMANDOK}",
      "Value": "linksave"
    },
    {
      "Command": "store",
      "Target": "notautofound",
      "Value": "!csvline"
    },
    {
      "Command": "gotoLabel",
      "Target": "csvSave",
      "Value": ""
    },
    {
      "Command": "label",
      "Target": "linksave",
      "Value": ""
    },
    {
      "Command": "storeAttribute",
      "Target": "xpath=//*[contains(@href,'donat')]@href",
      "Value": "!csvline"
    },
    {
      "Command": "gotoLabel",
      "Target": "csvSave",
      "Value": ""
    },
    {
      "Command": "label",
      "Target": "consave",
      "Value": ""
    },
    {
      "Command": "storeAttribute",
      "Target": "partialLinktext=contrib@href",
      "Value": "!csvline"
    },
    {
      "Command": "gotoLabel",
      "Target": "csvSave",
      "Value": ""
    },
    {
      "Command": "label",
      "Target": "donsave",
      "Value": ""
    },
    {
      "Command": "storeAttribute",
      "Target": "partialLinktext=donat@href",
      "Value": "!csvline"
    },
    {
      "Command": "gotoLabel",
      "Target": "csvSave",
      "Value": ""
    },
    {
      "Command": "label",
      "Target": "csvSave",
      "Value": ""
    },
    {
      "Command": "label",
      "Target": "csvSave",
      "Value": ""
    },
    {
      "Command": "store",
      "Target": "${!COL1}",
      "Value": "!csvline"
    },
    {
      "Command": "csvSave",
      "Target": "donatelink",
      "Value": ""
    }
  ]
}

GIve more detail about your work.

Your code is long and slow.

Add more info about the work, add image too i study a fast and easy solution to do it with few lines code.

Thank you!

Check if one of three conditions is met

  1. Link text contains ‘contrib’ OR 2. Link text contains ‘donat’ OR 3. Link itself contains ‘donat’

When any of the conditions is met, save the link

Some example websites
https://deborahforgeorgia.com/
https://www.jamesiajames.com/