$elem = $driver->find_element('app-lgs','id' ); Selenium::Screenshot->new( png => $driver->screenshot, exclude => [{ size => $elem->get_size, location => $elem->get_element_location, }] )->save( file => "screen.png" ); #### Selenium::Screenshot->new( png => $driver->screenshot, exclude => [{ size => { width => 10, height => 10 } location => { x => 5, y => 5 }, }]