The betIn site i'm trying to extract data from is betIn.I have navigated to the section that includes a list of all teams that will currently be playing on the current day and i'm trying to extract the information about the teams but i'm currently only able to obtain 13 teams instead of all the teams.At first i thought storing the values in an Array was the problem hence i opted to move to an ArrayList but still bore the same problem Below is my code:
public class test {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "/Users/user/Desktop/chromedriver");
WebDriver driver = new ChromeDriver();driver.navigate().to("https://sports.betin.co.ke/mobile#/dailyBundle/soccer/1-1000");
List<WebElement> rows = driver.findElements(By.cssSelector(".match-content.table-a.soccer"));
java.util.Iterator<WebElement> row_list = rows.iterator();
ArrayList<String> teams = new ArrayList<>();
ArrayList<String> bets = new ArrayList<>();
while(row_list.hasNext()){
WebElement rowItem = row_list.next();
String unnecessary = rowItem.findElement(By.cssSelector(".match-content__row--info")).getText();
String Content = rowItem.findElement(By.cssSelector(".match-content__info")).getText();
String relevantContent = Content.replace(unnecessary,"");
String bet = rowItem.findElement(By.cssSelector(".bets")).getText();
teams.add(relevantContent);
bets.add(bet);
}
System.out.println("These are the teams \n"+ teams);
System.out.println("The size of teams is "+ teams.size());
System.out.println("These are the odds \n"+ bets);
driver.close();
}
}