用post取数据
This commit is contained in:
parent
a2b5bfd692
commit
3f7242a264
|
|
@ -1,7 +1,9 @@
|
|||
using System.Diagnostics;
|
||||
using System.Net.Http;
|
||||
|
||||
namespace BotSharp.Abstraction.Browsing.Models;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
public class HttpRequestParams
|
||||
{
|
||||
[JsonPropertyName("url")]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using Azure;
|
||||
using System.IO;
|
||||
|
||||
namespace BotSharp.Plugin.WebDriver.Drivers.PlaywrightDriver;
|
||||
|
|
@ -123,6 +124,11 @@ public class PlaywrightInstance : IDisposable
|
|||
return page;
|
||||
}
|
||||
|
||||
page.Request += async (sender, e) =>
|
||||
{
|
||||
await HandleFetchRequest(e, message, args);
|
||||
};
|
||||
|
||||
page.Response += async (sender, e) =>
|
||||
{
|
||||
await HandleFetchResponse(e, message, args);
|
||||
|
|
@ -131,6 +137,13 @@ public class PlaywrightInstance : IDisposable
|
|||
return page;
|
||||
}
|
||||
|
||||
public async Task HandleFetchRequest(IRequest request, MessageInfo message, PageActionArgs args)
|
||||
{
|
||||
if (request.ResourceType == "fetch" || request.ResourceType == "xhr")
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public async Task HandleFetchResponse(IResponse response, MessageInfo message, PageActionArgs args)
|
||||
{
|
||||
if (response.Status != 204 &&
|
||||
|
|
|
|||
|
|
@ -21,6 +21,11 @@ public partial class PlaywrightWebDriver
|
|||
|
||||
if (args.EnableResponseCallback)
|
||||
{
|
||||
page.Request += async (sender, e) =>
|
||||
{
|
||||
await _instance.HandleFetchRequest(e, message, args);
|
||||
};
|
||||
|
||||
page.Response += async (sender, e) =>
|
||||
{
|
||||
await _instance.HandleFetchResponse(e, message, args);
|
||||
|
|
|
|||
Loading…
Reference in a new issue