商品导入
This commit is contained in:
parent
e8d182494a
commit
bf22260f59
|
|
@ -14,6 +14,13 @@ public partial class PlaywrightWebDriver
|
|||
{
|
||||
var result = new BrowserActionResult();
|
||||
var page = _instance.GetPage(message.ContextId);
|
||||
if (page == null)
|
||||
{
|
||||
return new BrowserActionResult
|
||||
{
|
||||
IsSuccess = false
|
||||
};
|
||||
}
|
||||
ILocator locator = page.Locator("body");
|
||||
int count = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,25 @@
|
|||
using HtmlAgilityPack;
|
||||
using System.Net.Http;
|
||||
|
||||
namespace BotSharp.Plugin.WebDriver;
|
||||
|
||||
public static class WebPageHelper
|
||||
{
|
||||
public static HtmlNode GetElement(string html, string selector)
|
||||
{
|
||||
var htmlDoc = new HtmlDocument();
|
||||
htmlDoc.LoadHtml(html);
|
||||
|
||||
return htmlDoc.DocumentNode.SelectSingleNode(selector);
|
||||
}
|
||||
|
||||
public static HtmlNodeCollection GetElements(string html, string selector)
|
||||
{
|
||||
var htmlDoc = new HtmlDocument();
|
||||
htmlDoc.LoadHtml(html);
|
||||
|
||||
return htmlDoc.DocumentNode.SelectNodes(selector);
|
||||
}
|
||||
|
||||
public static string RemoveElements(string html, string selector)
|
||||
{
|
||||
var htmlDoc = new HtmlDocument();
|
||||
|
|
|
|||
Loading…
Reference in a new issue