title: Selenium Traceback Error while using Python
body: <p>I'm using a script to automate a survey that I have to take every morning for work. When I run it it runs fine and it finishes without an issue. After running in the command prompt I keep getting this traceback error.</p>
  <p>Code:</p>
  <pre><code>from selenium import webdriver
  import time
  import warnings
  
  
  warnings.filterwarnings('ignore')
  driver = webdriver.Chrome(executable_path=&quot;./drivers/chromedriver.exe&quot;)
  driver.get('https://quickentry.teamhgs.com/')
  
  EmployeeID = *EEID*
  LastName = *LASTNAME*
  
  # Wait for webpage to load and click usa employee button
  time.sleep(1)
  USAEmployeeButton = driver.find_element_by_xpath('/html/body/section/div/div/div/div/div/div[2]/a[1]')
  USAEmployeeButton.click()
  
  # input employee button and last name then click verify
  EID = driver.find_element_by_xpath('//*[@id=&quot;empId&quot;]')
  EID.send_keys(EmployeeID)
  last = driver.find_element_by_xpath('//*[@id=&quot;empLastName&quot;]')
  last.send_keys(LastName)
  VerifyEmployeeID = driver.find_element_by_xpath('//*[@id=&quot;getemp&quot;]')
  VerifyEmployeeID.click()
  
  # wait for the verification to finish and click proceed
  time.sleep(10)
  ProceedButton = driver.find_element_by_xpath('//*[@id=&quot;proceed&quot;]')
  ProceedButton.click()
  
  # click no on all of them and then next and submit and Yes
  Q1No = driver.find_element_by_xpath('/html/body/section/div/div/div/div/div/div[2]/div[2]/div[2]/div[2]/label/p')
  Q1No.click()
  Next = driver.find_element_by_xpath('//*[@id=&quot;next-question&quot;]')
  Next.click()
  Q2No = driver.find_element_by_xpath('/html/body/section/div/div/div/div/div/div[2]/div[2]/div[2]/div[2]/label/p')
  Q2No.click()
  Next.click()
  Q3No = driver.find_element_by_xpath('/html/body/section/div/div/div/div/div/div[2]/div[2]/div[2]/div[2]/label/p')
  Q3No.click()
  Next.click()
  Q4No = driver.find_element_by_xpath('/html/body/section/div/div/div/div/div/div[2]/div[2]/div[2]/div[2]/label/p')
  Q4No.click()
  Submit_Button = driver.find_element_by_xpath('//*[@id=&quot;submit&quot;]')
  Submit_Button.click()
  time.sleep(1)
  Yes_Button = driver.find_element_by_xpath('/html/body/div[1]/div/div/div[2]/button[2]')
  Yes_Button.click()
  
  # check if it worked
  get_confirmation_div_text = driver.find_element_by_css_selector('.admit-msg text-center')
  Success_Message = &quot;Based on your answers, you are granted access to the site for today’s shift.  Please complete this questionnaire before arriving on-site for any shift moving forward until further notice. Stay safe.&quot;
  if get_confirmation_div_text.text == Success_Message:
      print(&quot;Test Was Successful&quot;)
  else:
      print(&quot;Test wasn't successful&quot;)
  
  # Close page when finished
  time.sleep(2)
  driver.close()
  </code></pre>
  <p>Error:</p>
  <pre><code>C:\Users\USERNAME\PycharmProjects\MorningAutomation\venv\Scripts\python.exe C:/Users/USERNAME/PycharmProjects/MorningAutomation/QuickEntry.py
  
  DevTools listening on ws://127.0.0.1:51345/devtools/browser/85f8fdee-9bc5-42ca-adb3-29fe65733ca5
  [26408:26860:1213/081313.939:ERROR:chrome_browser_main_extra_parts_metrics.cc(226)] crbug.com/1216328: Checking Bluetooth availability started. Please report if there is no report that this ends.
  [26408:26860:1213/081313.939:ERROR:chrome_browser_main_extra_parts_metrics.cc(229)] crbug.com/1216328: Checking Bluetooth availability ended.
  [26408:26860:1213/081313.940:ERROR:chrome_browser_main_extra_parts_metrics.cc(232)] crbug.com/1216328: Checking default browser status started. Please report if there is no report that this ends.
  [26408:26388:1213/081313.940:ERROR:device_event_log_impl.cc(214)] [08:13:13.940] USB: usb_device_handle_win.cc:1048 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
  [26408:26388:1213/081313.942:ERROR:device_event_log_impl.cc(214)] [08:13:13.941] USB: usb_device_handle_win.cc:1048 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
  [26408:26388:1213/081313.946:ERROR:device_event_log_impl.cc(214)] [08:13:13.945] USB: usb_device_handle_win.cc:1048 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
  [26408:26860:1213/081313.959:ERROR:chrome_browser_main_extra_parts_metrics.cc(236)] crbug.com/1216328: Checking default browser status ended.
  Traceback (most recent call last):
    File &quot;C:\Users\alex.olivas\PycharmProjects\MorningAutomation\QuickEntry.py&quot;, line 51, in &lt;module&gt;
      get_confirmation_div_text = driver.find_element_by_css_selector('.admit-msg text-center')
    File &quot;C:\Users\alex.olivas\PycharmProjects\MorningAutomation\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py&quot;, line 808, in find_element_by_css_selector
      return self.find_element(by=By.CSS_SELECTOR, value=css_selector)
    File &quot;C:\Users\alex.olivas\PycharmProjects\MorningAutomation\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py&quot;, line 1244, in find_element
      return self.execute(Command.FIND_ELEMENT, {
    File &quot;C:\Users\alex.olivas\PycharmProjects\MorningAutomation\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py&quot;, line 424, in execute
      self.error_handler.check_response(response)
    File &quot;C:\Users\alex.olivas\PycharmProjects\MorningAutomation\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py&quot;, line 247, in check_response
      raise exception_class(message, screen, stacktrace)
  selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {&quot;method&quot;:&quot;css selector&quot;,&quot;selector&quot;:&quot;.admit-msg text-center&quot;}
    (Session info: chrome=96.0.4664.93)
  Stacktrace:
  Backtrace:
          Ordinal0 [0x003C6903+2517251]
          Ordinal0 [0x0035F8E1+2095329]
          Ordinal0 [0x00262848+1058888]
          Ordinal0 [0x0028D448+1233992]
          Ordinal0 [0x0028D63B+1234491]
          Ordinal0 [0x002B7812+1406994]
          Ordinal0 [0x002A650A+1336586]
          Ordinal0 [0x002B5BBF+1399743]
          Ordinal0 [0x002A639B+1336219]
          Ordinal0 [0x002827A7+1189799]
          Ordinal0 [0x00283609+1193481]
          GetHandleVerifier [0x00555904+1577972]
          GetHandleVerifier [0x00600B97+2279047]
          GetHandleVerifier [0x00456D09+534521]
          GetHandleVerifier [0x00455DB9+530601]
          Ordinal0 [0x00364FF9+2117625]
          Ordinal0 [0x003698A8+2136232]
          Ordinal0 [0x003699E2+2136546]
          Ordinal0 [0x00373541+2176321]
          BaseThreadInitThunk [0x762DFA29+25]
          RtlGetAppContainerNamedObjectPath [0x772E7A9E+286]
          RtlGetAppContainerNamedObjectPath [0x772E7A6E+238]
  </code></pre>
  <p>I kept looking for something similar but none of those resolutions seemed to work for me.</p>