無法弄清楚如何將文本寫入彈出窗口,這是彈出窗口的外觀:<textarea style="position: absolute; padding: 0px; width: 1px; height: 1em; outline: currentcolor none medium;" autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" wrap="off"></textarea>這就是我嘗試使用XPath訪問它的方式:driver.find_element_by_xpath("/html/body/div/div[1]/textarea").send_keys("Some text here")在頁面上找不到該元素的錯誤提示:selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: /html/body/div/div[1]/textarea我也使用css_selector來訪問元素,但仍然是相同的錯誤。如何正確訪問彈出窗口?這是更多的HTML代碼:https : //pastebin.com/6jdix2Cm
添加回答
舉報
0/150
提交
取消