From 8cb29b147c642ed54d03cfc107e41c66e1c6410b Mon Sep 17 00:00:00 2001 From: jason Date: Mon, 25 Nov 2024 23:05:56 +0800 Subject: [PATCH] use IHttpClientFactory --- .../Browsing/Models/ElementLocatingArgs.cs | 1 - .../PlaywrightWebDriver.LocateElement.cs | 12 ------------ 2 files changed, 13 deletions(-) diff --git a/src/Infrastructure/BotSharp.Abstraction/Browsing/Models/ElementLocatingArgs.cs b/src/Infrastructure/BotSharp.Abstraction/Browsing/Models/ElementLocatingArgs.cs index a8b5af51..b50f2366 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Browsing/Models/ElementLocatingArgs.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Browsing/Models/ElementLocatingArgs.cs @@ -36,5 +36,4 @@ public class ElementLocatingArgs /// public bool Highlight { get; set; } public string HighlightColor { get; set; } = "red"; - public bool IsImage { get; set; } } diff --git a/src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightWebDriver.LocateElement.cs b/src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightWebDriver.LocateElement.cs index e9b4004e..8695fc5c 100644 --- a/src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightWebDriver.LocateElement.cs +++ b/src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightWebDriver.LocateElement.cs @@ -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) {