title: Selenium window keeps closing after executed on amazon scraper
body: <pre><code>import requests
  import csv
  from selenium import webdriver
  import os
  
  
  def get_page(url, headers):
      resposta = requests.get(url, headers=headers)
      if not (resposta.ok):
          print(f'O servidor respondeu:{resposta.status_code}')
      else:
          os.environ['PATH'] += r&quot;C:/SeleniumDrivers&quot;
          driver = webdriver.Chrome()
          elemento = driver.get(url)
  
  def main():
      url = 'https://www.amazon.es/s?k=teclado'
      headers = {&quot;User-Agent&quot;: &quot;Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0&quot;,&quot;Accept-Encoding&quot;: &quot;gzip, deflate&quot;,&quot;Accept&quot;: &quot;text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8&quot;, &quot;DNT&quot;: &quot;1&quot;,&quot;Connection&quot;: &quot;close&quot;, &quot;Upgrade-Insecure-Requests&quot;: &quot;1&quot;}
      get_page(url, headers)
  
  
  
  if __name__ == '__main__':
      main()
  </code></pre>
  <p>This is the code; when I execute it, the Amazon window opens but then it closes right after. All I want to do is retrieve the product names and prices.</p>