use IHttpClientFactory

This commit is contained in:
jason 2024-11-25 23:05:56 +08:00
parent 97e0b687ce
commit 8cb29b147c
2 changed files with 0 additions and 13 deletions

View file

@ -36,5 +36,4 @@ public class ElementLocatingArgs
/// </summary>
public bool Highlight { get; set; }
public string HighlightColor { get; set; } = "red";
public bool IsImage { get; set; }
}

View file

@ -17,18 +17,6 @@ public partial class PlaywrightWebDriver
ILocator locator = page.Locator("body");
int count = 0;
if (location.IsImage)
{
var handle = await page.QuerySelectorAsync("img");
byte[]? imageBytes = handle != null ? await handle.ScreenshotAsync() : null;
string? body = null;
if (imageBytes?.Any() == true)
{
body = Convert.ToBase64String(imageBytes);
}
return new BrowserActionResult { IsSuccess = true, Body = body };
}
// check if selector is specified
if (location.Selector != null)
{