I am running Playwright in .NET against a page full of links. I have collected the links with the following:
var collectionOfLinks = await Page.GetByRole(Microsoft.Playwright.AriaRole.Link).AllAsync();
var countOfLinks = collectionOfLinks.Count();
for (var i = 0; i < countOfLinks; i++)
{
var link = collectionOfLinks[i];
// do some work with the links
}
I have tried variations of
var linkUrl = link.getAttribute("href");
and
var linkUrl = link.getHref();
Nothing I’ve tried builds.