Skip to content
Advertisement

Parsing html using Selenium – class name contains spaces

I’m trying to parse some html using Selenium. The problem is that it raises error in case the class name contains spaces.

Here is the tag I’m searching for: <p class="p0 ng-binding">text</p>

I’ve tried these two options:

JavaScript

Could anybody give me a hint?

Advertisement

Answer

The p element has two classes: p0 and ng-binding.

Try this selector:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement