I'm attempting to use an xpath to click on a tbody but am having no luck.
My click function looks like this
Code: Select all
click(xpath){
WaitPageToLoad()
checkFail()
result := page.Evaluate("document.body.contains(document.evaluate('" xpath "', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue) ? 'true' : 'false'").value
if(result = "true"){
page.Evaluate("document.evaluate('" xpath "', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.click();")
}else{
MsgBox Error!
Reload
}
}
![Image](https://i.imgur.com/otC25SV.png)
This is how to website looks
![Image](https://i.imgur.com/hJWIfY7.png)
I am trying to click on those highlighted buttons.
This is the code:
Code: Select all
xp = /html/body/app-root/div/app-book-appointment/section/mat-card[1]/div[2]/div/div/full-calendar/div[2]/div/table/tbody/tr/td/div/div/div/table/tbody/tr[5]/td[1]
click(xp)
Code: Select all
document.querySelector("body > app-root > div > app-book-appointment > section > mat-card:nth-child(1) > div.ba-calender-card.card.shadow-sm > div > div > full-calendar > div.fc-view-harness.fc-view-harness-active > div > table > tbody > tr > td > div > div > div > table > tbody > tr:nth-child(5) > td.fc-daygrid-day.fc-day.fc-day-mon.fc-day-future.date-availiable").click()
Can someone help me with this?