selenium,错误 10047(不支持地址族),但使用 try/catch(有解决方法)

发布于 2024-11-26 16:04:12 字数 713 浏览 1 评论 0原文

我正在使用 C# 和 selenium。一切正常,没有问题。 今天在 Visual Studio 中调试我的程序时,我在这一行收到错误:

this.WebDriver = new FirefoxDriver(bin, profile);

错误是:

System.Net.Sockets.SocketError.AddressFamilyNotSupported
ErrorCde 10047

我使用的完整代码是:

var profile = new FirefoxProfile();
FirefoxBinary bin = new FirefoxBinary();
this.WebDriver = new FirefoxDriver(bin, profile);

我有一个解决方法:

var profile = new FirefoxProfile();
FirefoxBinary bin = new FirefoxBinary();
try
{
    this.WebDriver = new FirefoxDriver(bin, profile);
}
finally
{
}

我不知道为什么现在有这个错误,我已经切换最近选项有些错误,也许就是这个原因。

我能做些什么?如果我真的不需要的话,我不想忽略这个错误。

I am using C# and selenium. Everything was working okay, no problems.
Today when debugging my program in Visual Studio I get an error at this line:

this.WebDriver = new FirefoxDriver(bin, profile);

The error ist:

System.Net.Sockets.SocketError.AddressFamilyNotSupported
ErrorCde 10047

The complete code I use is:

var profile = new FirefoxProfile();
FirefoxBinary bin = new FirefoxBinary();
this.WebDriver = new FirefoxDriver(bin, profile);

I have a work around for that:

var profile = new FirefoxProfile();
FirefoxBinary bin = new FirefoxBinary();
try
{
    this.WebDriver = new FirefoxDriver(bin, profile);
}
finally
{
}

I don't know why I have this error now, I have switched on some errors in options recently, maybe this is the reason.

What can I do? I don't want to just ignore this error, if I really don't have to.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

耳根太软 2024-12-03 16:04:12

难道是你的防火墙阻止了你的程序?您可以再次禁用它进行测试吗?

Can it be that you have a firewall that blocks your program? Can you disable it an test again?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文