hi
i have a problem with web browser.i want to open a website like google in web browser and
writing in search box and then search it.
i can open sites in web browser but i don't know how to fill textboxes and submit it.
thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Anupam SinghRank #643 · 3.7K reputationPosted Jun 26, 2014, 10:41 PM EDT
this may help : http://www.c-sharpcorner.com/UploadFile/6897bc/using-webbrowser-control/
Abolfazl155 reputationPosted Jun 26, 2014, 10:56 PM EDT
but i use web browser,i can navigate to site but i can't change elements value like text boxes.
i use this code to fill google text box and click on search button:
private void button1_Click(object sender, EventArgs e)
{
webBrowser1.Navigate("google.com");
webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(web_h);
}
private void web_h(object sender, WebBrowserDocumentCompletedEventArgs e)
{
WebBrowser b = (WebBrowser)sender;
b.Document.GetElementById("gbqfq").InnerText = "door";
b.Document.GetElementById("gbqfba").InvokeMember("click");
}
but i face with this error: System.NullReferenceException