url - https://www.etmoney.com/mutual-funds/equity/focused/77
On the particular website I have to scape all the fund size and add all up and compare it later using Testng assertions. Challenge being that there are multiple delimiter on fund size (₹ , and space) 3 delimiters
for ex:(scraped fund size)
₹110 Crs
₹8,696 Crs
₹3,460 Crs
₹711 Crs
₹5,990 Crs
₹26,218 Crs
₹7,907 Crs
₹1,780 Crs
₹956 Crs
₹1,708 Crs
₹1,330 Crs
₹5,825 Crs
₹18,712 Crs
Final output e like
110
8696
3460
711
5990
26218
7907
1780
956
1708
1330
5825
18712
int total = 0;
List<WebElement> totalFunds = driver.findElements(By.xpath("//div[@class='card-bordy']/div/div/div/div/div[2]/div/div/div[2]/div/p[2]"));
for(int i=0;i<totalFunds.size();i++) {
String funds = totalFunds.get(i).getText();
String fu = funds.split(" ")[0];
System.out.println(fu.split("₹")[1]);
Error - "java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1"