title: Protractor AngularJS CSS selector finding multiple elements
body: <p>I am new to CSS and am trying to avoid using xpath in my Protractor AngularJS test automations. I am trying to get a specific element in the list, which Im getting, however Protractor tells me there are more than one element found for locator.  In the future I want to avoid this as I'm not always going to want first on the list.  I am slightly confused about CSS and exactly how to get where I'm going and the documentation I have found has been vague. I am trying to grab Marketing Venue element but will also need to grab the other elements beneath as well at some point. The top code is AngularJS and how I am currently grabbing the text. Thanks in advance.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>var iPlanLevel=element(by.css("div:nth-of-type(2) &gt; div:nth-of-type(2) &gt; div &gt; div:nth-of-type(1) &gt; span")).getText().then(function (text) {
    console.log(text);
  }
  );
  
  &lt;!-- begin snippet: js hide: false --&gt;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="home-info"&gt;
  
    &lt;span class="web-developer-id-class-details"&gt;&lt;/span&gt;
    &lt;div class="home-top home-section"&gt;&lt;/div&gt;
    &lt;span class="web-developer-id-class-details"&gt;&lt;/span&gt;
    &lt;div class="home-bottom home-section"&gt;
      &lt;h3&gt;&lt;/h3&gt;
      &lt;span class="web-developer-id-class-details"&gt;&lt;/span&gt;
      &lt;div class="home-box"&gt;
        &lt;span class="web-developer-id-class-details"&gt;&lt;/span&gt;
        &lt;span class="home-name"&gt;&lt;/span&gt;
        &lt;br&gt;&lt;/br&gt;
  
  
        Lindemannstrasse 88
  
        &lt;br&gt;&lt;/br&gt;
  
  
        Dortmund 44137
  
        &lt;br&gt;&lt;/br&gt;
        &lt;br&gt;&lt;/br&gt;
        &lt;span class="web-developer-id-class-details"&gt;&lt;/span&gt;
        &lt;div class="property-group meduim"&gt;
          &lt;div&gt;&lt;/div&gt;
          &lt;span&gt;
  
                      MarketingVenue
  
                  &lt;/span&gt;
        &lt;/div&gt;
        &lt;span class="web-developer-id-class-details"&gt;
  
                  .property-group.meduim
  
              &lt;/span&gt;
        &lt;div class="property-group meduim"&gt;
          &lt;div&gt;&lt;/div&gt;
          &lt;span&gt;
  
                      December 31, 2016
  
                  &lt;/span&gt;
        &lt;/div&gt;
        &lt;span class="web-developer-id-class-details"&gt;&lt;/span&gt;
        &lt;div class="property-group meduim"&gt;&lt;/div&gt;
        &lt;div&gt;&lt;/div&gt;
        &lt;br&gt;&lt;/br&gt;
      &lt;/div&gt;
      &lt;span class="web-developer-id-class-details"&gt;&lt;/span&gt;
      &lt;div class="home-box"&gt;&lt;/div&gt;
    &lt;/div&gt;
  
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>