I am trying to select all of the links contained under this one div in this kind of structure:
<div id = "logged_hits">
<div class="toHigh nl">
<a href="(link i want to click)">/a>
</div>
</div>
I am trying to click all the links under the "logged_hits" id since the structure of the html contains many links under this one div. I am selecting the div by its XPath here:
List<IWebElement> allLinks = driver.FindElements(By.XPath("/html/body/div[6]")).ToList();
Then looping through each element in the list
foreach (var value in allLinks)
{
Console.WriteLine(value.GetAttribute("href").ToString());
}
I get no values since I dont think it can find the a tags. Any help would be greatly appriciated