selenium.common.exceptions.MoveTargetOutOfBoundsException: Message: move target out of bounds


关于ActionChains(driver).move_by_offset(x,y)时,move target out of bounds的问题

move_by_offset()中使用坐标都是针对上一步的计算的,若不想计算,可使用reset_actions() 重置为(0,0)。

action = ActionChains(driver)
action.move_by_offset(x, y).click_and_hold().move_to_element(target).release().perform()
action.reset_actions()