i'm trying to log in a site with username + password through ac# code. i found out that it uses Ajax to authenticate...
how should i implement such login ? the elements in the web page doesn't seem to have an "id"...
i tried to implement it using HtmlAgilityPack but i don't think this is the correct direction... i can't simulate a click button since i don't find "id" for the button.
if (tableNode.Attributes["class"].Value == "loginTable")
{
var userInputNode =
tableNode.SelectSingleNode("//input[@data-logon-popup-form-user-name-input='true']");
var passwordInputNode =
tableNode.SelectSingleNode("//input[@data-logon-popup-form-password-input='true']");
userInputNode.SetAttributeValue("value", "myemail@gmail.com");
passwordInputNode.SetAttributeValue("value", "mypassword");
var loginButton = tableNode.SelectSingleNode("//div[@data-logon-popup-form-submit-btn='true']");
}
This question is quite broad but I'll help you in the general direction:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.