Regex in Python to find Rows in Table
<p>i`m using python to automate some test, and at one point i find a table with rows, but this rows are of two different clases:</p>

<p>You have class name "gris-claro-tr" and "gris-oscuro-tr".</p>

<p>I need to iterate the whole table, finding the text of every row. Until now, i have:</p>

<pre><code>        for row in driver.find_elements_by_class_name("gris-claro-tr"):    
            cell = row.find_elements_by_tag_name("td")[1]
            print (cell.text)
</code></pre>

<p>But of course, only works for the rows with that class. I have to do the same thing for "gris-oscuro-tr". However, if i could find a regex that could find both row`s class, i would get the text of every row in that table, no matter if it is "gris-claro-td" or "gris-oscuro-td". </p>

<p>The question is: how can i make that regex? </p>

<p>Is it something like "gris-"+"*" ?</p>

<p>Thank you very much!</p>

<p>If you insist on XPATH you can use</p>

<pre><code>driver.find_elements_by_xpath("//*[@class='gris-claro-tr'] or [@class='gris-oscuro-td'] ")
</code></pre>

<p><code>*</code> can be replced by your tag name</p>

python regex webdriver