title: CSS locator: unable to locate element via code
body: <p>Here is the links I am working on : </p>
  
  <p><a href="https://www.formula1.com/en/results.html/2017/drivers.html" rel="nofollow noreferrer">https://www.formula1.com/en/results.html/2017/drivers.html</a></p>
  
  <p>Im trying to retrieve all the names under Driver column.</p>
  
  <p>Following is the css selector Im using in code</p>
  
  <pre><code>dname = name.find_element_by_css_selector('span.hide-for-mobile').text
  </code></pre>
  
  <p>Testing the code in  css selector plugins.See the screenshot <a href="https://i.stack.imgur.com/HtoYA.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HtoYA.jpg" alt="enter image description here"></a></p>
  
  <p>Below is the code:</p>
  
  <pre><code>from selenium import webdriver
  import os
  import csv
  
  chromeDriver = "/home/manoj/workspace2/RedTools/test/chromedriver"
  os.environ["webdriver.chrome.driver"] = chromeDriver
  driver = webdriver.Chrome(chromeDriver)
  driver.get("https://www.formula1.com/en/results.html/2017/drivers.html")
  
  driverNames = driver.find_elements_by_xpath("//th[contains(.,'Driver')]")
  
  for name in driverNames:
      dname = name.find_element_by_css_selector('span.hide-for-mobile').text
      print(dname)
      print('its done')
  </code></pre>
  
  <p>The Error Im getting at this moment is:</p>
  
  <blockquote>
    <p>selenium.common.exceptions.NoSuchElementException: Message: no such
    element: Unable to locate element: {"method":"css
    selector","selector":"span.hide-for-mobile"}</p>
  </blockquote>
  
  <p>What is that im doing incorrect. Help here would greatly appreciated. </p>