title: How to select next immediate element in css selector in python selenium?
body: <p>I have the DOM structure as follows.</p>
  
  <pre><code>&lt;ul&gt;
    &lt;li&gt;
      &lt;a href="#" role="button" class="js-pagination link" data-page="1"&gt;1&lt;/a&gt;
    &lt;/li&gt;
    &lt;li&gt;
      &lt;a href="#" role="button" class="js-pagination link active" data-page="2"&gt;2&lt;/a&gt;
    &lt;/li&gt;
    &lt;li&gt;
      &lt;a href="#" role="button" class="js-pagination link " data-page="3"&gt;3&lt;/a&gt;
    &lt;/li&gt;
    &lt;li&gt;
      &lt;a href="#" role="button" class="js-pagination link " data-page="4"&gt;4&lt;/a&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>I have to select next immediate element (not adjacent element) after element that contains <code>class="js-pagination link active"</code>. In our case it is third <code>li</code> element.
  I tried the following css selector </p>
  
  <pre><code>"ul li a[class='js-pagination link active'] + li"
  </code></pre>
  
  <p>But it is not working since its looking for <code>li</code> in the same level of <code>a</code> tag. How can we do it using css selector?</p>
  
  <p>I cannot use .has() since I am using this selector in selenium css select to find elements.</p>