The ViewSource() method seems to take more than 30ms on big sites for what is basically copying a string.
Is there any faster way to checking if an html element exists (maybe with a custom handler)?
public async Task<bool> EleExists()
{
string script = "(function() { return document.getElementsByClassName('playerIcon').length; })();";
string returnValue = "0";
await browser.EvaluateScriptAsync(script).ContinueWith(x =>
{
if (x.Result.Success && x.Result.Result != null)
returnValue = x.Result.Result.ToString();
});
return (int.Parse(returnValue) > 0);
}
Users browsing this forum: Google [Bot] and 15 guests