这是我试图自动执行一些点击的网站:
我尝试使用Xpath和单击按钮FullXpath,但仍然没有运气。
这是简单的代码:
w = webdriver.Chrome(executable_path='chromedriver.exe',
chrome_options=options)
w.get("https://quillbot.com/")
time.sleep(5)
pasteXpath = "//button[contains(@class,'outlinedPrimary') and .//span[contains(text(),'Paste Text')]]"
element = w.find_element_by_xpath(pasteXpath).click()
Run Code Online (Sandbox Code Playgroud)
但它失败并在控制台中显示以下消息:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="inOutContainer"]/div[2]/div[2]/div/div[1]/div/div/div[1]/div/div/div[2]/div/div/button/span[1]/div"}
Run Code Online (Sandbox Code Playgroud)
请告诉我如何使用 selenium 自动执行此点击。