If element is not visible or present then refresh the page in 5sec interval until the element is visible. Once visible click on it

Hello,
I have an element with the XPath ‘//tbody/tr[1]/td[3]/a[1]’. This element becomes visible at times after 5 seconds and sometimes after 60 seconds. My goal is to check if the element is visible or present, and if so, click on it. If the element is not visible, I want to continuously refresh the page every 5 seconds until the element becomes visible or present. Once the element is visible, I would like to click on it.

Could someone please help me with this? This is urgent; please assist me.

I had a similiar problem. I add a pause before the command to be sure to the element will be load. Its not perfect but worked