Skip to content Skip to sidebar Skip to footer

How To InvokeMember Using HtmlAgilityPack

I want to use HtmlAgilityPack class to login. But I don't know how. This is what I've tried. But it's not working. txtUserName.Text = 'username'; txtPassword.Text = 'password'; Htm

Solution 1:

I found a way to login using Selenium and I think it's the best way to do it:

IWebDriver driver = new FirefoxDriver();
driver.Navigate().GoToUrl("Your Address Login");
IWebElement query = driver.FindElement(By.Id("username"));
query.SendKeys("Your Username");
query = driver.FindElement(By.Id("password"));
query.SendKeys("Your Password");
query.Submit();

download selenium for dotnet

After download add reference WebDriver.dll and use namespace OpenQA.Selenium.Firefox;

Learn more Here


Solution 2:

HtmlAgilityPack can only parse html.

Use WebClient instead.


Post a Comment for "How To InvokeMember Using HtmlAgilityPack"