K
K
khusnullin6652020-06-10 15:30:33
C++ / C#
khusnullin665, 2020-06-10 15:30:33

How to remake a program with WebDriver for the server?

I have a program that accesses the site through my browser and collects data from the site.
How can I change it so that it does not use my browser, but the server? Is it possible to do this?

IWebDriver web;

            string LOGIN = LoginBox.Text; 

            string PASSWORD = PassBox.Text; 

            web = new ChromeDriver();

       
                web.Navigate().GoToUrl("https://elschool.ru/logon/index"); // Переход в ES.

                web.FindElement(By.XPath(" //input[@id='login']")).SendKeys(LOGIN); 

                web.FindElement(By.XPath("//input[@id='password']")).SendKeys(PASSWORD); 

                web.FindElement(By.XPath("//button[@id='sub-btn']")).Click(); 

                web.FindElement(By.LinkText("Перейти в дневник")).Click(); 

                web.FindElement(By.LinkText("Табель")).Click();


This is roughly how it happens.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question