in the example below
var url = "http://anglesharp.azurewebsites.net/PostUrlencodeNormal";
var config = new Configuration { AllowRequests = true };
var html = DocumentBuilder.Html(new Uri(url), config);
var form = html.Forms[0] as IHtmlFormElement;
var name = form.Elements["Name"] as IHtmlInputElement;
var number = form.Elements["Number"] as IHtmlInputElement;
var active = form.Elements["IsActive"] as IHtmlInputElement;
name.Value = "Test";
number.Value = "1";
active.IsChecked = true;
form.Submit();
And yet, it complains that Value is not an extension of IHtmlInputElement, use SetValue instead
but SetValues is basically a dictionary and I have no ideas how to use that with AngleSharp.
In another example, https://anglesharp.github.io/docs/Forms.html, it is also using
var queryInput = form.Elements["q"] as IHtmlInputElement;
if (queryInput != null)
{
queryInput.Value = "anglesharp";
}
I assume after I set queryInput to a value, I can do
var input = queryInput.Value to ensure the value is set.
The problem I have is I am setting three fields, namely
userID, pin, password before I hit submit. If I use AngleSharp, it bring me back to the same page which means that the authentication is not valid. I know the fields are filled properly with the value, I am just not sure it is actually passing those values over.
Thanks.