2024-06-17 11:08:17 发布
网友
我正在做这件事
html = browser.find_element_by_xpath('/html/body/div[4]/div/div/div[2]') html.send_keys(Keys.END)
ERROR=selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
你可以用 驱动程序.execute_脚本(“window.scrollTo(0,Y)”) 其中Y是高度(在全高清显示器上为1080)
您可以尝试将元素滚动到selenium视图中:
element = browser.find_element_by_xpath('/html/body/div[4]/div/div/div[2]') driver.execute_script("arguments[0].scrollIntoView();", element)
或者,如果要垂直向下滚动:
driver.execute_script("window.scrollTo(0, Y)")
Y可以是100, 200, and so on...
100, 200, and so on...
或者使用ActionChains
ActionChains
ActionChains(driver).move_to_element(html).perform()
你可以用 驱动程序.execute_脚本(“window.scrollTo(0,Y)”) 其中Y是高度(在全高清显示器上为1080)
您可以尝试将元素滚动到selenium视图中:
或者,如果要垂直向下滚动:
Y可以是
100, 200, and so on...
或者使用
ActionChains
相关问题 更多 >
编程相关推荐