WebRunner.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:PyWebRunner 作者: IntuitiveWebSolutions 项目源码 文件源码
def move_to(self, selector, click=False):
        '''
        Move to the element matched by selector or passed as argument.

        Parameters
        ----------
        selector: str
            Any valid CSS selector
        click: bool
            Whether or not to click the element after hovering
            defaults to False
        '''
        try:
            elem = self.get_element(selector)

            action = webdriver.ActionChains(self.browser)
            action.move_to_element(elem)
            if click:
                action.click(elem)

            action.perform()
        except WebDriverException:
            print("move_to isn't supported with this browser driver.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号