title: Using location_once_scrolled_into_view and want to center
body: <p>I am using location_once_scrolled_into_view to scroll to specific elements on a web page. After I find these elements, I am taking screenshots of them. The problem I am running in to is that the page ends up scrolling up to high and puts the elements underneath the Navigation bar. Once it takes the screenshot it is just a picture of the nav bar. Is there a way to continue using the location_once_scrolled_into_view but have it not scroll all the way to the top of the page. But instead to the center of the page? </p>
  
  <p>Here is the code for my screenshot function:</p>
  
  <pre><code>def take_screenshot(element, driver, filename):
      location = element.location_once_scrolled_into_view
  
      size = element.size
      png = driver.get_screenshot_as_png() # saves screenshot of entire page
      im = Image.open(BytesIO(png)) # uses PIL library to open image in memory
  
  
  
      left = location['x']
      top = location['y']
      right = location['x'] + size['width']
      bottom = location['y'] + size['height']
  
      im = im.crop((left, top, right, bottom)) # defines crop points
      w , h = im.size
      if w &gt; 0 and h &gt; 0:
          im.save(filename)# saves new cropped image 
  </code></pre>