gpt4 book ai didi

c# - 错误 "Non-generic method"IParentNode.QuerySelector (string) "cannot be used with type arguments. "

转载 作者:行者123 更新时间:2023-11-30 22:57:03 25 4
gpt4 key购买 nike

我尝试使用 AngleSharp 库登录网站。我为此使用代码。

class Program
{
const string sourceToSite = "https://mail.ru/";
const string sourceToTarget = "https://e.mail.ru/messages/inbox/";

static async void QueryToOrders()
{
var config = Configuration.Default.WithDefaultLoader().WithCookies();
var context = BrowsingContext.New(config);
await context.OpenAsync(sourceToSite);
var check = context.Active.QuerySelector<IHtmlFormElement>("form#Auth").SubmitAsync(new { Login = EMAIL + "@mail.ru", Password = PASSWORD }).Result;
var msgs = await context.OpenAsync(sourceToTarget);
}
}

我得到一个错误:

"The error "Non-generic method" IParentNode.QuerySelector (string) "cannot be used with type arguments."

问题
如何修复错误?

最佳答案

我认为采用通用参数的 QuerySelector 形式是一种扩展方法。您需要为其所在的命名空间添加 using:

using AngleSharp.Extensions;

关于c# - 错误 "Non-generic method"IParentNode.QuerySelector (string) "cannot be used with type arguments. ",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53895841/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com