title: Selenium - Python - AttributeError: 'WebDriver' object has no attribute 'find_element_by_name'
body: <p>I am trying to get Selenium working with Chrome, but I keep running into this error message (and others like it):</p>
  <blockquote>
  <p>AttributeError: 'WebDriver' object has no attribute 'find_element_by_name'</p>
  </blockquote>
  <p>The same problem occurs with <code>find_element_by_id()</code>, <code>find_element_by_class()</code>, etc.</p>
  <p>I also could not call <code>send_keys()</code>.</p>
  <p>I am just running the test code provided at <em><a href="https://chromedriver.chromium.org/getting-started" rel="noreferrer">ChromeDriver - WebDriver for Chrome - Getting started</a></em>.</p>
  <pre><code>import time
  
  from selenium import webdriver
  
  driver = webdriver.Chrome(&quot;C:/Program Files/Chrome Driver/chromedriver.exe&quot;)  # Path to where I installed the web driver
  
  driver.get('http://www.google.com/');
  
  time.sleep(5) # Let the user actually see something!
  
  search_box = driver.find_element_by_name('q')
  
  search_box.send_keys('ChromeDriver')
  
  search_box.submit()
  
  time.sleep(5) # Let the user actually see something!
  
  driver.quit()
  </code></pre>
  <p>I am using Google Chrome version 103.0.5060.53 and downloaded ChromeDriver 103.0.5060.53 from <em><a href="https://chromedriver.chromium.org/downloads" rel="noreferrer">Downloads</a></em>.</p>
  <p>When running the code, Chrome opens and navigates to google.com, but it receives the following output:</p>
  <pre class="lang-none prettyprint-override"><code>C:\Users\Admin\Programming Projects\Python Projects\Clock In\clock_in.py:21: DeprecationWarning: executable_path has been deprecated, please pass in a Service object
    driver = webdriver.Chrome(&quot;C:/Program Files/Chrome Driver/chromedriver.exe&quot;)  # Optional argument, if not specified will search path.
  
  DevTools listening on ws://127.0.0.1:58397/devtools/browser/edee940d-61e0-4cc3-89e1-2aa08ab16432
  [9556:21748:0627/083741.135:ERROR:device_event_log_impl.cc(214)] [08:37:41.131] USB: usb_service_win.cc:415 Could not read device interface GUIDs: The system cannot find the file specified. (0x2)
  [9556:21748:0627/083741.149:ERROR:device_event_log_impl.cc(214)] [08:37:41.148] USB: usb_device_handle_win.cc:1048 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
  [9556:21748:0627/083741.156:ERROR:device_event_log_impl.cc(214)] [08:37:41.155] USB: usb_device_handle_win.cc:1048 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
  [9556:21748:0627/083741.157:ERROR:device_event_log_impl.cc(214)] [08:37:41.156] USB: usb_device_handle_win.cc:1048 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
  [9556:21748:0627/083741.157:ERROR:device_event_log_impl.cc(214)] [08:37:41.156] USB: usb_device_handle_win.cc:1048 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
  Traceback (most recent call last):
    File &quot;C:\[REDACTED]&quot;, line 27, in &lt;module&gt;
      search_box = driver.find_element_by_name('q')
  AttributeError: 'WebDriver' object has no attribute 'find_element_by_name'
  [21324:19948:0627/083937.892:ERROR:gpu_init.cc(486)] Passthrough is not supported, GL is disabled, ANGLE is
  </code></pre>
  <p><em>Note: I replaced the file path for this post.</em></p>
  <p>I don't think that the DevTools listening section is related to the issue, but I thought I would include it, just in case.</p>