title: modify class of a div in selenium using python
body: <p>I am trying to change the page layout of a webpage from grid list to simple list but the problem it is not a dropdown or button. it is changing adding active class to the div element how can i achieve this using selenium in python</p>
  <pre><code>&lt;a href=&quot;#&quot; class=&quot;dropdown-item title_mode active&quot; id=&quot;0&quot;&gt;&lt;span class=&quot;fas fa-th-large fa-fw &quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; Detailed&lt;/a&gt;
  &lt;a href=&quot;#&quot; class=&quot;dropdown-item title_mode &quot; id=&quot;1&quot;&gt;&lt;span class=&quot;fas fa-th-large fa-fw &quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; grid Detailed&lt;/a&gt;
  &lt;a href=&quot;#&quot; class=&quot;dropdown-item title_mode &quot; id=&quot;2&quot;&gt;&lt;span class=&quot;fas fa-th-large fa-fw &quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;list  Detailed&lt;/a&gt;
  &lt;a href=&quot;#&quot; class=&quot;dropdown-item title_mode &quot; id=&quot;3&quot;&gt;&lt;span class=&quot;fas fa-th-large fa-fw &quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;simple Detailed&lt;/a&gt;
  </code></pre>