How to get the value of an element in Python + Selenium?
问题 I have got this HTML element in my Python (3.6.3) code (as Selenium webelement of course): <span class="ocenaCzastkowa masterTooltip" style="color:#000000;" alt="Kod: pd1<br/>Opis: praca domowa<br/>Waga: 2,00<br/>Data: 12.09.2017<br/>Nauczyciel: (NAME CENSORED)">5</span> and I want to get the value at the end (which is 5 in this case) and I have got no idea how to get it. obviously I can't use webelement.get_attribute() cause I don't know the name of the attribute. 回答1: Try the following code