make_screenshots.py 文件源码

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

项目:biweeklybudget 作者: jantman 项目源码 文件源码
def _reconcile_drag_preshot(self):
        ofxdiv = self.browser.find_element_by_id('ofx-2-0')
        logger.info('ofxdiv location: %s size: %s',
                    ofxdiv.location, ofxdiv.size)
        pos_x = (ofxdiv.location['x'] - 400) + (ofxdiv.size['width'] / 4)
        pos_y = (ofxdiv.location['y'] - 50) + (ofxdiv.size['height'] / 2)
        self.browser.execute_script(
            "$('body').append($('%s'));" % self._cursor_script(pos_x, pos_y)
        )
        actions = ActionChains(self.browser)
        actions.move_to_element(ofxdiv)
        actions.click_and_hold()
        actions.move_by_offset(-400, -50)
        actions.perform()
        self.browser.get_screenshot_as_file('docs/source/foo.png')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号