I am coding a python web automation selenium script.
In the script, I use driver.find_element_by_xpath('xpath')
to find elements on Binary.com. This means I would have to preload Binary.com and copy xpaths of the elements I need to find. For most elements the method works but for a few I realised that the Xpath is unique to each login.
For example, if I login in now and try to copy the xpath of a certain element it will be //*[@id="tp1602844250562"]
but if the page is reloaded or I try to login on a different window the xpath would have then changed to //*[@id="tp1602844157070"]
. Please note they are not the same id numbers. This means I cannot use one xpath on a separate page login
The desired element has an HTML code:
<input type="text" class="time hasTimepicker" tab-index="-1" value="00:00" readonly="" id="tp1602844157070">
You can try below with class instead of id as the id is getting pulled from DB i guess-