使用Selenium Firefox驱动程序打开Firefox,使用ForceBindIP绑定特定IP

xzv2uavs  于 2023-02-04  发布在  其他
关注(0)|答案(1)|浏览(268)

bounty将在5天后过期。此问题的答案可获得+500声望奖励。tripleee正在查找规范答案:“任何解决方案?”这种无答案的反复攻击表明,一个能解决问题的实际答案是有价值的。

我有以下代码。

IWebDriver webDriver = null;

System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startinfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo.FileName = "ForceBindIP64.exe";
startInfo.Arguments = " -i 10.1.1.111 \"C:\\Program Files\\Mozilla Firefox\\firefox.exe\"";
process.StartInfo = startInfo;
process.Start();
process.WaitForExit();

System.Uri = new System.Uri("http://localhost:7055/hub");

Thread.Sleep(5000);

webDriver = new RemoteWebDriver(uri, options);

我在这里尝试做的是,我尝试使用ForceBindIP绑定一个特定的IP和一个浏览器示例,这个浏览器示例是由selenium Firefox驱动程序打开的,实际上是geckodriver。在webDriver = new RemoteWebDriver(uri, options);,我得到了以下异常错误。

我知道我得到以上错误可能是因为我定义的端口号可能是错误的,或者我将不得不打开浏览器使用Firefox驱动程序。也可能是其他东西。有人有一个解决方案。我将不得不绑定的驱动程序打开的浏览器的示例绑定到一个特定的IP通过ForceBindIP。

46scxncf

46scxncf1#

不可能使用ForcebindIp启动firefox浏览器。因为firefox使用系统中的第一个活动ip。由于不可能使用focebindip启动驱动程序,因此,与其尝试以这种方式启动,您可以通过将您的其他internet变成代理并在firefox中添加代理来使用您的internet。

相关问题