我是编程新手,我只知道如何在python中修复它。这段代码最初是有效的,但当我稍后尝试它时,出现了错误。
using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using System.Threading;
namespace AternosServer
{
class Program
{
static void Main(string[] args)
{
IWebDriver driver = new ChromeDriver();
ChromeOptions options = new ChromeOptions();
options.AddArgument("--ignore-certificate-errors");
options.AddArgument("--ignore-ssl-errors");
options.AcceptInsecureCertificates = true;
driver.Navigate().GoToUrl("https://aternos.org/go/");
driver.FindElement(By.Id("user")).SendKeys("X");
driver.FindElement(By.Id("password")).SendKeys("X");
driver.FindElement(By.Id("login")).Click();
driver.Navigate().GoToUrl("https://aternos.org/server/");
}
}
}
发布于 2020-08-29 00:11:22
我使用selenium和c#运行了你的代码4次。同时在您的网站上注册- https://aternos.org/servers/
之后,将我的凭证放入并测试它,它工作正常,没有发现任何问题。不需要写代码的最后一行-
driver.Navigate().GoToUrl("https://aternos.org/server/");
当您单击登录按钮时,它将重定向到该页面。
如果与c#有关的selenium有任何问题,请让我知道。
https://stackoverflow.com/questions/63636650
复制相似问题