Your solution was very close, simply add [6] if you need e. g. the 6th match
See also: FAQ: How can I find the n-th link with a specific text?
Demo macro - here we click the first and the 6th 7Zip download link:
{
"Name": "xpath text",
"CreationDate": "2023-2-5",
"Commands": [
{
"Command": "open",
"Target": "https://www.7-zip.org/download.html",
"Value": "",
"Description": ""
},
{
"Command": "click",
"Target": "xpath=(//a[text()='Download'])[1]",
"Value": "",
"Description": "First Download link"
},
{
"Command": "click",
"Target": "xpath=(//a[text()='Download'])[6]",
"Value": "",
"Description": "6th Download link!!!"
},
{
"Command": "click",
"Target": "xpath=(//*[text()='Download'])[8]",
"Value": "",
"Description": "no *a* - So this searches for the text in any element and not just links (not recommended here)"
}
]
}