title: Python: How do I check for the values of each row and column?
body: <p>I have this table, and I need to verify the column names first then the second row's values. I'm new to Python and I tried to check on other site such as this: <a href="https://www.tutorialspoint.com/how-to-get-all-the-values-of-a-particular-row-based-on-a-condition-in-a-worksheet-in-selenium-with-python" rel="nofollow noreferrer">https://www.tutorialspoint.com/how-to-get-all-the-values-of-a-particular-row-based-on-a-condition-in-a-worksheet-in-selenium-with-python</a> but do we have something like an automatic indexing for checking of values? One approach is I can save the column names in an array and add assertion to check if they are equal. But how do I get the column names?</p>
  <p><a href="https://i.stack.imgur.com/rehzq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rehzq.png" alt="enter image description here" /></a></p>
  <p>For the column names, I have to verify if it has the same data in the array:</p>
  <pre><code>columnNames:[&quot;Column 1&quot;, &quot;Column 2&quot;, &quot;Column 3&quot;, &quot;Column 4&quot;, &quot;Column 5&quot;, &quot;Column 6&quot;, &quot;Column 7&quot;, &quot;Column 8&quot;, &quot;Column 9&quot;, &quot;Column 10&quot;, &quot;Column 11&quot;]
  </code></pre>
  <p>For the value row I need to know how do I specify index but automatic? Or should I make it like <code>row[2].value</code>? But I'm not sure. :/ I'm so confused...</p>
  <p>I only currently have this one :/</p>
  <pre><code>columnNames: [&quot;Column 1&quot;, &quot;Column 2&quot;, &quot;Column 3&quot;, &quot;Column 4&quot;, &quot;Column 5&quot;, &quot;Column 6&quot;, &quot;Column 7&quot;, &quot;Column 8&quot;, &quot;Column 9&quot;, &quot;Column 10&quot;, &quot;Column 11&quot;]
      activeWorksheet = excelTitle.active
      for item in range(1,activeWorksheet.max_row+1):
          global excelColumnNames
          excelColumnNames.append(activeWorksheet.cell(row=item))
  </code></pre>