title: Navigate pagination with Selenium Webdriver
body: <p>I am trying to navigate a list of links that looks like this:
  <a href="https://i.stack.imgur.com/pNkTb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pNkTb.png" alt="this list of links" /></a></p>
  <p>from a series of webpages like  <a href="https://dati.comune.milano.it/callgroup/e6528afc-bd2c-417b-99a8-d7704f942a42" rel="nofollow noreferrer">this one</a> and then retrieve the links on each one.
  This is the HTML:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;ul class="pagination"&gt;
    &lt;li class="active"&gt;
      &lt;a href="/dataset groups=heal&amp;amp;_groups_limit=0&amp;amp;page=1"&gt;1&lt;/a&gt;
    &lt;/li&gt;
    &lt;li&gt;
      &lt;a href="/dataset?groups=heal&amp;amp;_groups_limit=0&amp;amp;page=2"&gt;2&lt;/a&gt;
    &lt;/li&gt;
    &lt;li&gt;
      &lt;a href="/dataset?groups=heal&amp;amp;_groups_limit=0&amp;amp;page=3"&gt;3&lt;/a&gt;
    &lt;/li&gt;
    &lt;li class="disabled"&gt;
      &lt;a href="#"&gt;...&lt;/a&gt;
    &lt;/li&gt;
    &lt;li&gt;
      &lt;a href="/dataset?groups=heal&amp;amp;_groups_limit=0&amp;amp;page=7"&gt;7&lt;/a&gt;
    &lt;/li&gt;
    &lt;li&gt;
      &lt;a href="/dataset?groups=heal&amp;amp;_groups_limit=0&amp;amp;page=2"&gt;»&lt;/a&gt;
    &lt;/li&gt;
  &lt;/ul&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>I managed to find the number of pages, so I am trying to iterate over that.
  My idea was to select the active element, and the click() on the next one. Being unfamiliar with Xpath I am stumbling on how to do that.</p>
  <p>This is the code I am using:</p>
  <p><code>driver.find_element_by_xpath(&quot;//li[class='active']/a//following&quot;).click()</code></p>
  <p>Any help would be appreciated.</p>