I cannot click this element, tried CSS selector and Xpaths. Can anyone help, keep getting invalid selector, XPath/cannot locate element. Yet when I use the inspector to validate these elements they are correct, why can't my web driver script locate them?
HTML:
<div class="ap-ba-well-button">
<!-- ngIf: service.booking_status_type !== 'Not Bookable Online' -->
<button ng-if="service.booking_status_type !== 'Not Bookable Online'" class="ap-button ng-binding ng-scope">Book</button>
<!-- end ngIf: service.booking_status_type !== 'Not Bookable Online' -->
<!-- ngIf: service.booking_status_type === 'Not Bookable Online' -->
</div>
Code trials:
driver.find_element(By.CSS_SELECTOR, ".ap-popover-well-group-single:nth-child(1) .ap-button").click()
driver.find_element_by_xpath(“//?/button[@innertext='Book']”)
driver.find_element_by_xpath(“/html//span[@class='ng-scope']/ap-booking-app[@class='ng-scope']/div[@class='ap-ba-wrapper ng-scope']/div[@class='ap-ba-container with-footer']//ap-booking-app-step-services[@data='data']/div/div[1]//div[@class='ap-ba-well-single ng-scope']//button[@class='ap-button ng-binding ng-scope']”)
any help will be great