I want to extract information from a website, but in order to do that I need to login. Basically I can't authenticate with a HTTP/Web/Server request so I have to do it via browser, using WebDriver Selenium (Chrome). Now since the information can't be found through "view source-code", driver.PageSource doesn't work for example. Now when I do what has been suggested in the mentioned thread, I still get the wrong source code (there has also been the same problem reported in the comments). I need to get the code from the Inspector.
Any ideas? Thanks in advance!
class Program
{
static void Main(string[] args)
{
string url = "link";
IWebDriver driver = new ChromeDriver();
driver.Navigate().GoToUrl(url);
IWebElement email = driver.FindElement(By.Id("login-email-input-field"));
IWebElement password = driver.FindElement(By.Id("login-password-input"));
email.SendKeys("email");
password.SendKeys("password");
IWebElement login = driver.FindElement(By.Id("login-btn"));
login.Click();
driver.Navigate().GoToUrl(url);
Thread.Sleep(10000);
//Trying to get the inspect element code here
IWebElement element = driver.FindElement(By.Id("id"));
var html = element.GetAttribute("innerHTML");
Console.WriteLine(html);
}
}
}