I am trying to parse html using Selenium . The problem is that it throws an error if the class name contains spaces.
Here is the tag I'm looking for: <p class="p0 ng-binding">text</p>
I tried these two options:
result.find_element_by_class_name('departure').find_element_by_css_selector('p.p0 ng-binding').text
result.find_element_by_class_name('departure').find_element_by_class_name('p0 ng-binding').text
>>> selenium.common.exceptions.InvalidSelectorException: Message: The given selector p0 ng-binding is either invalid or does not result in a WebElement. The following error occurred:
InvalidSelectorError: Compound class names not permitted
Can someone give me a hint?
source
share