selenium中ActionChains常用的方法

来源:赵克立博客 分类: Python 标签:--发布时间:2018-05-18 10:59:33最后更新:2018-05-18 11:02:02浏览:3678
版权声明:
本文为博主原创文章,转载请声明原文链接...谢谢。o_0。
更新时间:
2018-05-18 11:02:02
温馨提示:
学无止境,技术类文章有它的时效性,请留意文章更新时间,如发现内容有误请留言指出,防止别人"踩坑",我会及时更新文章

action = ActionChains(self.driver)

click(on_element=None) ——单击鼠标左键

click_and_hold(on_element=None) ——点击鼠标左键,不松开


context_click(on_element=None) ——点击鼠标右键


double_click(on_element=None) ——双击鼠标左键


drag_and_drop(source, target) ——拖拽到某个元素然后松开


drag_and_drop_by_offset(source, xoffset, yoffset) ——拖拽到某个坐标然后松开


key_down(value, element=None) ——按下某个键盘上的键


key_up(value, element=None) ——松开某个键


move_by_offset(xoffset, yoffset) ——鼠标从当前位置移动到某个坐标,注意这里的位移是指从鼠标当前坐标移动的大小移动多少加减多少就行


move_to_element(to_element) ——鼠标移动到某个元素


move_to_element_with_offset(to_element, xoffset, yoffset) ——移动到距某个元素(左上角坐标)多少距离的位置


perform() ——执行链中的所有动作


release(on_element=None) ——在某个元素位置松开鼠标左键


send_keys(*keys_to_send) ——发送某个键到当前焦点的元素


send_keys_to_element(element, *keys_to_send) ——发送某个键到指定元素



微信号:kelicom QQ群:215861553 紧急求助须知
Win32/PHP/JS/Android/Python