title: Looping through table and clicking spefic button on rows that match a certain criteria
body: <p>I'm have a little struggle and ur help will be well appreciated.</p>
  <p>I'm trying to navigate the script to go over this
  <a href="https://i.stack.imgur.com/JRfF1.png" rel="nofollow noreferrer">table</a> and if it sees &quot;active&quot; on a row, to perform delete for the row. The script should check all rows.</p>
  <p>Currently the code have I have is :</p>
  <pre><code>class Test_Table_Test(BaseTest):
  def test_table(self):
      self.driver.get('file:///loc/location')
      main_table = self.driver.find_element(By.CSS_SELECTOR, &quot;body&quot;)
      main_table2 = main_table.find_element(By.CSS_SELECTOR, &quot;.ftco-section&quot;)
      main_table3 = main_table2.find_element(By.CSS_SELECTOR, &quot;.container&quot;)
      main_table4 = main_table3.find_element(By.CSS_SELECTOR, &quot;div.row:nth-child(2)&quot;)
      body = main_table4.find_element(By.TAG_NAME, &quot;tbody&quot;)
      rows = body.find_elements(By.TAG_NAME, &quot;tr&quot;)
      cells = body.find_elements(By.TAG_NAME, &quot;td&quot;)
      #print(len(rows))
  
      for i in range(len(rows)):
          columns = rows[i].find_elements(By.TAG_NAME, &quot;td&quot;)
          for j in range(len(columns)):
              if columns[j].text == &quot;Active&quot;:
                  columns[4].click()
  </code></pre>
  <p>This is the html:
  <a href="https://i.stack.imgur.com/bZt6I.png" rel="nofollow noreferrer">the button is underlined</a></p>
  <p>Current result =  The test is passing, but it is not doing the job.</p>