问个 Python selenium 的问题

查看 19|回复 0
作者:guoguobaba   
```python
for x, y in param:
center_x = int(x) - div_size['width'] / 2
center_y = int(y) - div_size['height'] / 2
logging.info("click at (%.2f, %.2f)" % (center_x, center_y))
action_chains.move_to_element_with_offset(element, center_x,center_y).click().perform()
time.sleep(random.randint(0, 10) / 10)
```
按文档说 move_to_element_with_offset 是 Move the mouse by an offset of the
specified element. Offsets are relative to the top-left corner of the element.
是以左上为原点,但是我这里必须以 element 中心为原点才能成功呢?
您需要登录后才可以回帖 登录 | 立即注册

返回顶部