def get_element_padding(page, selector):
 js_script = ('\n        var $element = $(\'%(selector)s\');\n\n        element_padding = {\n            \'padding-top\': $element.css(\'padding-top\').replace("px", ""),\n            \'padding-right\': $element.css(\'padding-right\').replace("px", ""),\n            \'padding-bottom\': $element.css(\'padding-bottom\').replace("px", ""),\n            \'padding-left\': $element.css(\'padding-left\').replace("px", "")\n        };\n\n        return element_padding;\n    ' % {'selector': selector})
 return page.browser.execute_script(js_script)

def get_element_padding ( page , selector ) : js_script = ( '\n        var $element = $(\'%(selector)s\');\n\n        element_padding = {\n            \'padding-top\': $element.css(\'padding-top\').replace("px", ""),\n            \'padding-right\': $element.css(\'padding-right\').replace("px", ""),\n            \'padding-bottom\': $element.css(\'padding-bottom\').replace("px", ""),\n            \'padding-left\': $element.css(\'padding-left\').replace("px", "")\n        };\n\n        return element_padding;\n    ' % { 'selector' : selector } ) return page . browser . execute_script ( js_script )
get padding of the element with given selector .