I tried to find the element by class name with the following code:
result.find_element_by_class_name("0")
result is a WebElement containing the element I'm looking for. (I'm sure of it)
html-code :
<tr class="0"></tr>
But if I do this, I get the following error:
selenium.common.exceptions.InvalidSelectorException: Message: This selector 0 is either invalid or does not use WebElement. The following error has occurred:
InvalidSelectorError: Invalid or illegal class name specified
There are other WebElements inside result that I can find through the class name (for example, there is an element named last , and if I try to get it, it works)
So, how can I find an element by class name if the class name is Number ? (which is a string)
source share