-1

Trying to get the individual rows of the table on this page: http://www.flashscore.com/match/n77wzKlQ/#match-summary

Here's the code I have so far... not working because the class name has spaces. I've tried replacing spaces with .'s but still no luck.

Code:

List<WebElement> homeEvents = body.findElements(By.className(".summary-vertical.fl"));
re0603
  • 387
  • 1
  • 4
  • 19
  • Add the entire value of the element from class="value" attribute, the exact value with spaces. – lauda Oct 23 '16 at 17:15
  • I have already tried that. It gives a compound classes not supported error. – re0603 Oct 23 '16 at 17:23
  • Possible duplicate of [Compound class names are not supported error in WebDriver](http://stackoverflow.com/questions/15699900/compound-class-names-are-not-supported-error-in-webdriver) – Saurabh Gaur Oct 23 '16 at 18:32

2 Answers2

2

.summary-vertical.fl is a css selector and not a className

And yes selenium class name wont support spaces.

Change your selector from

body.findElements(By.className(".summary-vertical.fl"));

to

 body.findElements(By.cssSelector(".summary-vertical.fl"));
Madhan
  • 5,750
  • 4
  • 28
  • 61
0

The only case where you can replace a space(s) with a dot(s) for a class value is when utilizing the customized CSS formula that is: TagName.class or .class