I was trying to do test on a website and I need to click this button: click xpath
But when I run the code, it shows No such elemeny: unable to locate element.
I have checked the code, there is no iframe. But interestingly, I can find "Publish to All" through inspect, but cannot find it through "View Page SourceView Page Source"
Here is the context from windows powershell
Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div[2]/div[2]/div[2]/div[2]/div[1]/div/form/div/div[8]/div/table/tbody/tr/td[2]/table/tbody/tr[1]/td/div/div[3]/div[2]/div[1]/a"} (Session info: chrome=108.0.5359.125) Stacktrace: Backtrace: (No symbol) [0x00D6F243] (No symbol) [0x00CF7FD1] (No symbol) [0x00BED04D] (No symbol) [0x00C1C0B0] (No symbol) [0x00C1C22B] (No symbol) [0x00C4E612] (No symbol) [0x00C385D4] (No symbol) [0x00C4C9EB] (No symbol) [0x00C38386] (No symbol) [0x00C1163C] (No symbol) [0x00C1269D] GetHandleVerifier [0x01009A22+2655074] GetHandleVerifier [0x00FFCA24+2601828] GetHandleVerifier [0x00E18C0A+619850] GetHandleVerifier [0x00E17830+614768] (No symbol) [0x00D005FC] (No symbol) [0x00D05968] (No symbol) [0x00D05A55] (No symbol) [0x00D1051B] BaseThreadInitThunk [0x774400F9+25] RtlGetAppContainerNamedObjectPath [0x77C17BBE+286] RtlGetAppContainerNamedObjectPath [0x77C17B8E+238]
And my codes are here:
try: publish_button = browser.find_element(By.XPATH, "/html/body/div[2]/div[2]/div[2]/div[2]/div[1]/div/form/div/div[8]/div/table/tbody/tr/td[2]/table/tbody/tr[1]/td/div/div[3]/div[2]/div[1]/a") publish_button.click() except Exception as e: print(e) print(9999)
browser.quit()