问题描述
driver.find_element_by_id("author").click() # This opens the windows file selector
pyautogui.write('John')
pyautogui.press('enter')
selenium.common.exceptions.ElementnotinteractableException: Message: Element <select id="author" class="select2-authors-multiple select2-hidden-accessible" name="author[]"> Could not be scrolled into view
driver.execute_script("arguments[0].scrollIntoView();",element)
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);",element);
Thread.sleep(500);
解决方法
因为您使用的是 pyautogui
尝试而不是滚动,所以使用箭头 down
进行导航,像这样 pyautogui.press("down")