Hi, does Wisej have same function like VS webBrowse.Document.GetElementByID() like following, thanks a lot.
public Form1()
{
InitializeComponent();
//navigate to you destination
webBrowser1.Navigate("https://www.certiport.com/portal/SSL/Login.aspx");
}
bool is_sec_page = false;
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
if (!is_sec_page)
{
//get page element with id
webBrowser1.Document.GetElementById("c_Username").InnerText = "username";
webBrowser1.Document.GetElementById("c_Password").InnerText = "pass";
//login in to account(fire a login button promagatelly)
webBrowser1.Document.GetElementById("c_LoginBtn_c_CommandBtn").InvokeMember("click");
is_sec_page = true;
}
//secound page(if correctly aotanticate
else
{
//intract with sec page elements with theire ids and so on
}
}
No. It’s impossible to handle inner elements in an iframe from a different origin. If the iframe (WebBrowser control) is from the same origin you ay be able to achieve what you want but it must be done on the client in javascript.
Please login first to submit.