Reputation: 1
Please find the attached screenshot for html tags:We need to print the 3 which in react-text
The following code i have tried: WebElement MyText = driver.findElement(By.xpath("(//div[@class='badge-number'])[6]"));
JavascriptExecutor jse = (JavascriptExecutor)driver;
String platformName = (String) jse.executeScript("return arguments[0].value;", MyText); System.out.println("text:"+MyText.getText());
I just want to print that minutes and seconds and they are dynamic.
Upvotes: 0
Views: 595
Reputation: 570
Might not be the best solution but with react is kind a hard - so I can suggest getting the page source from the selenium driver then use some regex to extract what you need (like groups between the " char and also between the span elements.
Upvotes: 0