Hello. I am still just learning, but I have already encountered a problem (for me this is a problem), which endures my brain for the third day. Rookies all that is possible (in theory) and could not find a clear answer. In general, the essence of this. There is a table:

<table width="100%" border="0" cellspacing="1" cellpadding="0"> <tr><td>...</td></tr> --- таких элементов очень много все они похожи на нижние <tr bgcolor="#EFEFEF"> <td class="content">Пол:</td> <td colspan="3" class="content"> <input type="radio" name="sex" value="M" id="sex"> М <input type="radio" name="sex" value="F" id="sex"> Ж </tr> <tr bgcolor="#EFEFEF"> <td class="content">Паспортные данные:</td> <td colspan="3" class="content">ЗР 316350 </tr> </table> 

The question is how to pull all the text out of the tag? Of all the tags.

Tried so

 driver.find_element_by_xpath("//table/tr/td[@class='content']").text 

does not work.

    1 answer 1

    So you tried?

     driver.find_element_by_xpath("//table/tr/td[@class='content']").get_attribute('innerHTML')