title: selenium error(while taking a screenshot) 'NoneType' object has no attribute 'encode'
body: <p>I am using selenium on Google Cloud Platform and geckodriver to take a screenshot of a page but
  my selenium throws an error like this...</p>
  
  <pre><code>get_screenshot_as_png
  
  return base64.b64decode(self.get_screenshot_as_base64().encode('ascii'))
  
  AttributeError: 'NoneType' object has no attribute 'encode'
  </code></pre>
  
  <p>I am using firefox 68.xx and geckodriver 78(I am not sure tho)</p>
  
  <pre><code>cap = DesiredCapabilities().FIREFOX
  cap['marionette'] = True
  #cap['binary'] = '/usr/local/bin/firefox'
  
  options = Options()
  #options.headless = True
  options.add_argument("--headless")
  options.add_argument("--no-sandbox")
  options.add_argument("start-maximized")
  options.add_argument("disable-infobars")
  options.add_argument("--disable-extensions")
  options.add_argument("--disable-dev-shm-usage")
  
  
  date_time  = datetime.datetime.now()
  page_time = datetime.timedelta(hours = +9)
  print(page_time+date_time)
  page_time = page_time + date_time
  page_time = page_time.strftime('%Y.%m.%d')
  
  driver.save_screenshot(page_time+"screen.png")
  </code></pre>
  
  <p>Thank you for your help in advance!</p>