2017-10-13 195 views

回答

1

你可以調用腳本.scrollIntoView()在你的元素作爲參數傳遞:

driver.execute_script("arguments[0].scrollIntoView();", element) 

還有move_to_element()內置硒行動:

from selenium.webdriver.common.action_chains import ActionChains 

ActionChains(driver).move_to_element(element).perform() 

的差異是完全在這裏強調:

相關問題