how to get the data from the table with python selenium if the class and xpath are always changing?
<pre><code>&lt;table border="0" cellpadding="0" cellspacing="0" class="A490847cc28c94895bcf96e98abdb2b32209xB"&gt;
                  &lt;tbody&gt;
                   &lt;tr&gt;
                    &lt;td style="vertical-align:top"&gt;
                     &lt;table border="0" cellpadding="0" cellspacing="0" class="A490847cc28c94895bcf96e98abdb2b32206" cols="8" style="border-collapse:collapse;"&gt;
                      &lt;tbody&gt;
                       &lt;tr height="0"&gt;
                        &lt;td style="WIDTH:56.91mm;min-width:56.91mm"&gt;
                        &lt;/td&gt;

                       &lt;/tr&gt;
                       &lt;tr valign="top"&gt;

                        &lt;td class="A490847cc28c94895bcf96e98abdb2b32126c Pe5cd046a24fa44ef80e79727141463c6_1_r7"&gt;
                         &lt;div class="A490847cc28c94895bcf96e98abdb2b32126"&gt;
                          Total Tutorials
                         &lt;/div&gt;
                        &lt;/td&gt;


                        &lt;td class="A490847cc28c94895bcf96e98abdb2b32144c Pe5cd046a24fa44ef80e79727141463c6_1_r7 Pe5cd046a24fa44ef80e79727141463c6_1_r6"&gt;
                         &lt;div class="A490847cc28c94895bcf96e98abdb2b32144"&gt;
                          &lt;div style="WIDTH:19.98mm;"&gt;
                           &lt;div class="A490847cc28c94895bcf96e98abdb2b32141"&gt;
                            &lt;span class="A490847cc28c94895bcf96e98abdb2b32140"&gt;
                             Attendance
                            &lt;/span&gt;
                           &lt;/div&gt;
                           &lt;div class="A490847cc28c94895bcf96e98abdb2b32143"&gt;
                            &lt;span class="A490847cc28c94895bcf96e98abdb2b32142"&gt;
                             %
                            &lt;/span&gt;
                           &lt;/div&gt;
                          &lt;/div&gt;
                         &lt;/div&gt;
                        &lt;/td&gt;
                       &lt;/tr&gt;
                       &lt;tr valign="top"&gt;
                        &lt;td class="A490847cc28c94895bcf96e98abdb2b32149cl Pe5cd046a24fa44ef80e79727141463c6_1_r5" style="HEIGHT:6.35mm;"&gt;
                         &lt;div class="A490847cc28c94895bcf96e98abdb2b32149"&gt;
                          CSFf
                         &lt;/div&gt;
                        &lt;/td&gt;
                        &lt;td class="A490847cc28c94895bcf96e98abdb2b32153cr"&gt;
                         &lt;div class="A490847cc28c94895bcf96e98abdb2b32153"&gt;
                          9
                         &lt;/div&gt;
                        &lt;/td&gt;
                        &lt;td class="A490847cc28c94895bcf96e98abdb2b32157cr"&gt;
                         &lt;div class="A490847cc28c94895bcf96e98abdb2b32157"&gt;
                          7
                         &lt;/div&gt;
                        &lt;/td&gt;
                        &lt;td class="A490847cc28c94895bcf96e98abdb2b32161cl"&gt;
                         &lt;div class="A490847cc28c94895bcf96e98abdb2b32161"&gt;
                          0
                         &lt;/div&gt;
                        &lt;/td&gt;
                        &lt;td class="A490847cc28c94895bcf96e98abdb2b32165cl"&gt;
                         &lt;div class="A490847cc28c94895bcf96e98abdb2b32165"&gt;
                          0
                         &lt;/div&gt;
                        &lt;/td&gt;
                        &lt;td class="A490847cc28c94895bcf96e98abdb2b32169cr"&gt;
                         &lt;div class="A490847cc28c94895bcf96e98abdb2b32169"&gt;
                          4.0000
                         &lt;/div&gt;
                        &lt;/td&gt;
                        &lt;td class="A490847cc28c94895bcf96e98abdb2b32173cr"&gt;
                         &lt;div class="A490847cc28c94895bcf96e98abdb2b32173"&gt;
                          4.0000
                         &lt;/div&gt;
                        &lt;/td&gt;
                        &lt;td class="A490847cc28c94895bcf96e98abdb2b32177cr Pe5cd046a24fa44ef80e79727141463c6_1_r6"&gt;
                         &lt;div class="A490847cc28c94895bcf96e98abdb2b32177"&gt;
                          84.62
                         &lt;/div&gt;
                        &lt;/td&gt;
</code></pre>

<p>I am working with python selenium web driver.I want the loop through the table for the text inside the <code>td</code> inside <code>tr</code> tag <a href="http://stackoverflow.com/questions/11533982/how-to-read-table-data-using-selenium-python">like this</a><br>But problem here is the class name is always changing and xpath and css_selector is also changing.example xpath will be like this <code>.//*[@id='P825048fc6b084257a601fde4805c8c33_1_oReportCell']/table/tbody/tr[2]/td/table/tbody/tr/td/table/tbody/tr[3]/td[8]/div</code> <br>But the <code>id</code> is changing always.so couldn't apply <code>driver.find_element_by_id()</code>.I think regular expressions or BeautifulSoup can be used to solve this.I am beginner to regex.So is there any way this could be solved?</p>

<p>The parent of table id has kind of unique in which every time the number changes but the ReportCell is appended to it so using that we can find its children like this</p>

<pre><code>//*[contains(@id,'oReportCell')]/table/tbody/tr[2]/td/table/tbody/tr/td/table/tbody/tr[3]/td[1]
</code></pre>

python regex selenium-webdriver beautifulsoup