I am having this code
driver.implicitly_wait(300) #I have tried different timers
driver.find_element_by_xpath("(//button[@aria-pressed='false'])[1]").click()
but I get this error
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"(//button[@aria-pressed='false'])[1]"}
However this exist in my HTML like
<div class="webix_el_box" style="width:90px; height:26px">
<button aria-pressed="false" type="button" class="webix_img_btn" style="line-height:22px;">
<span class="webix_icon_btn fa-lock red" style="max-width:22px;">
</span> Read Only
</button>
</div>
I have also tried to use the xpath
//button[@class='webix_img_btn']//child::span[@class='webix_icon_btn fa-lock red']
both xpath worked fine in Google Chrome In the website I am able to find the button using Ctrl+F and 'Read Only', can I use it in Selenium?
Edit: It is not working because of Selenium Driver is one page behind ajax call after large json data download