title: InvalidSelectorException: Message: invalid selector: An invalid or illegal selector was specified error clicking on div ng-click element with Selenium
body: <p>I am trying to select </p>
  
  <pre><code>&lt;div ng-click="select('expert')" class="select-exp__item select-exp__item_active" ng-class="{'select-exp__item_active': 'expert'===selected}" style=""&gt;
  </code></pre>
  
  <p>I have tried a few things</p>
  
  <pre><code>driver.find_element_by_css_selector("div[ng-click='select('expert')']").click()
  
  driver.find_element_by_class_name('select-exp__item-title').click()
  
  WebDriverWait(driver, 10).until(EC.element_to_be_clickable(By.XPATH("//div[@class='select-exp__item select-exp__item_active']").click()
  
  WebDriverWait(driver, 10).until(EC.element_to_be_clickable(By.XPATH("//div[@class='select-exp__item select-exp__item_active' and contains(@ng-click, 'select('expert')')]").click()
  </code></pre>
  
  <p>...but I get the same error each time:</p>
  
  <blockquote>
    <p>InvalidSelectorException: Message: invalid selector: An invalid or illegal selector was specified</p>
  </blockquote>
  
  <p>Grateful for any guidance, have googled "selenium ng-click" extensively without much luck and still learning Selenium, thank you. </p>
  
  <p>Here's the full HTML:</p>
  
  <pre><code>&lt;div class="agmodal__wrapper agmodal onboarding-wrapper ng-scope agmodal__wrapper--visible" ng-controller="OnboardingController as ctrl" ng-class="{'agmodal__wrapper--visible': ctrl.shown}" tabindex="-1" style=""&gt;
      &lt;div class="onboarding"&gt;
          &lt;div class="onboarding__body"&gt;
              &lt;!-- ngIf: ctrl.onboardingService.step === 1 --&gt;&lt;section class="select-exp step ng-scope" ng-if="ctrl.onboardingService.step === 1" style=""&gt;
      &lt;div class="select-exp__header step__header"&gt;
          &lt;div class="select-exp__title step__title"&gt;Welcome to AMZScout PRO Extension&lt;/div&gt;
          &lt;div class="select-exp__desc step__desc"&gt;
              PRO Extension helps you find the perfect product to sell on Amazon
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="select-exp__body"&gt;
          &lt;div class="select-exp__body-title"&gt;
              Select your experience level with Amazon&lt;/div&gt;
          &lt;div class="select-exp__body-desc"&gt;
              We will adjust the amount of pop up tips and certain parameters based on your experience. You will be able
              to
              change this choice later in the Settings.&lt;/div&gt;
          &lt;div class="select-exp__items"&gt;
              &lt;div ng-click="select('beginner')" class="select-exp__item" ng-class="{'select-exp__item_active': 'beginner'===selected}"&gt;
                  &lt;div class="select-exp__item-title"&gt;Beginner&lt;/div&gt;
                  &lt;div class="select-exp__item-desc"&gt;If you are new to Amazon research, you’ll see vital parameters that
                      will help you choose a great
                      product quickly. Great for learning.&lt;/div&gt;
              &lt;/div&gt;
              &lt;div ng-click="select('expert')" class="select-exp__item select-exp__item_active" ng-class="{'select-exp__item_active': 'expert'===selected}" style=""&gt;
                  &lt;div class="select-exp__item-title"&gt;Expert&lt;/div&gt;
                  &lt;div class="select-exp__item-desc"&gt;As an expert, you’ll see the full data and be able to fine-tune your
                      research.&lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
  </code></pre>