I'm working on a small tool in C# and using .Net MAUI. Part of it is loading a website and parsing a list of items from that site.

I can load and parse the elements, but the site has a "load more" button instead of pages for the item list. Thus, I need to push that button via code until all elements are loaded and hence get the full html for parsing.

Based on what I found online I tried using angleSharp

b = ( IHtmlElement )document.GetElementsByClassName("theClassName").First();
b.DoClick();

as well as the MAUI WebView component

myWebview.EvaluateJavaScriptAsync(@" 
                var button = document.querySelector('.myClassName');
                if (button) {
                    button.click();
                }
            ");

The first one did nothing, the second one never completes. I also looked at HtmlAgilityPack but didn't find anything to invoke a click.

What am I doing wrong?