If I look at the link up to the table row 'Africa - CAF..', it has a span id of 'c88' -
<div class="competition_row clickable" onclick="showMatches('88','2023-08-20','Live')"><a href="/competitions/international/caf-confederation-cup/" class="flag eurl" title="Go to CAF Confederation Cup page"> </a>Africa - CAF Confederation Cup<span id="clive88" class="clive"></span></div><span id="c88"></span>
Your code is instructed to stop at 'c87' -
wait.Until(ExpectedConditions.ElementIsVisible(By.Id("c87")));
Increase this and it will work. To do this dynamically, replace your single 'wait.Until(...)' statement with a loop that finds all the 'span' elements with IDs starting with 'c'. Then, for each of those elements, it clicks on them, waits until they become stale, and then adds the page source to your 'htmlList' -
public async Task<List<string>> GetHtmlSelenium(string url)
{
List<string> htmlList = new List<string>();
ChromeOptions options = new ChromeOptions();
options.AddArgument("--disable-gpu");
options.AddArgument("--no-sandbox");
options.AddArgument("--ignore-certificate-errors");
options.AddArgument("--enable-logging");
using (IWebDriver driver = new ChromeDriver(options))
{
driver.Navigate().GoToUrl(url);
IList<IWebElement> parentElements = driver.FindElements(By.CssSelector(".competition_row.clickable"));
foreach (IWebElement parentElement in parentElements)
{
try
{
parentElement.Click();
}
catch (Exception ex) { }
var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(25));
IList<IWebElement> spanElements = driver.FindElements(By.CssSelector("span[id^='c']"));
foreach (IWebElement spanElement in spanElements)
{
try
{
wait.Until(ExpectedConditions.ElementToBeClickable(spanElement));
spanElement.Click();
wait.Until(ExpectedConditions.StalenessOf(spanElement));
htmlList.Add(driver.PageSource);
}
catch (Exception ex) { }
}
}
}
return htmlList;
}