title: Unable to locate element selenium webdriver
body: <p>I'm trying to scrape the following website: <a href="https://www.bancosantander.es/es/particulares/prestamos/prestamo-coche/simulador" rel="nofollow noreferrer">https://www.bancosantander.es/es/particulares/prestamos/prestamo-coche/simulador</a></p>
  
  <p>What I'm trying to do:</p>
  
  <p>Simulate the amount and duration by moving the slider. I'm trying to locate them with my webdriver.</p>
  
  <p>But I can't, in fact I'm starting to scraping.</p>
  
  <p>The error that appears is as follows:</p>
  
  <pre><code>/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:12: DeprecationWarning: use options instead of chrome_options
    if sys.path[0] == '':
  
  ---------------------------------------------------------------------------
  
  NoSuchElementException                    Traceback (most recent call last)
  
  &lt;ipython-input-29-f71d54453a68&gt; in &lt;module&gt;()
       20     pass
       21 webdriver.save_screenshot('sreenshot0.png')
  ---&gt; 22 webdriver.find_element_by_xpath("//*[@class='res r1']")
       23 
       24 webdriver.save_screenshot('sreenshot0.png')
  
  /usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py in find_element_by_xpath(self, xpath)
      392             element = driver.find_element_by_xpath('//div/td[1]')
      393         """
  --&gt; 394         return self.find_element(by=By.XPATH, value=xpath)
      395 
      396     def find_elements_by_xpath(self, xpath):
  
  /usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py in find_element(self, by, value)
      976         return self.execute(Command.FIND_ELEMENT, {
      977             'using': by,
  --&gt; 978             'value': value})['value']
      979 
      980     def find_elements(self, by=By.ID, value=None):
  
  /usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py in execute(self, driver_command, params)
      319         response = self.command_executor.execute(driver_command, params)
      320         if response:
  --&gt; 321             self.error_handler.check_response(response)
      322             response['value'] = self._unwrap_value(
      323                 response.get('value', None))
  
  /usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/errorhandler.py in check_response(self, response)
      240                 alert_text = value['alert'].get('text')
      241             raise exception_class(message, screen, stacktrace, alert_text)
  --&gt; 242         raise exception_class(message, screen, stacktrace)
      243 
      244     def _value_or_default(self, obj, key, default):
  
  NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@class='res r1']"}
    (Session info: headless chrome=72.0.3626.121)
    (Driver info: chromedriver=72.0.3626.121,platform=Linux 4.14.79+ x86_64)
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>from selenium import webdriver
  from selenium.webdriver.common.by import By
  from selenium.webdriver.support.ui import WebDriverWait
  from selenium.webdriver.support import expected_conditions as EC
  import time
  chrome_options = webdriver.ChromeOptions()
  chrome_options.add_argument('--headless')
  chrome_options.add_argument('--no-sandbox')
  chrome_options.add_argument('--disable-dev-shm-usage')
  chrome_options.add_argument('--start-maximized')
  chrome_options.add_argument('window-size=4400x2200')
  webdriver = webdriver.Chrome('chromedriver',chrome_options=chrome_options)
  webdriver.maximize_window()
  url = "https://www.bancosantander.es/es/particulares/prestamos/prestamo-coche/simulador"
  webdriver.get(url)
  
  try:
      webdriver.find_element_by_xpath("//button[@onclick=\"_W034_Cookie_Directive_WAR_W034_Cookie_Directiveportlet_.hidePortlet()\"]").click()
  except NoSuchElementException:
      pass
  webdriver.save_screenshot('sreenshot0.png')
  webdriver.find_element_by_xpath("//*[@class='res r1']")
  
  webdriver.save_screenshot('sreenshot0.png')
  </code></pre>