Click here to Skip to main content
15,992,922 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to use the web browser controller to pop up the website and with the html element changed in c#.

For example i click on the button, it will pop up to the website and change the html element.

private void btn_TestLibFunc_Click(object sender, EventArgs e)
        {
            Process.Start("chrome.exe", "http://google.com");
            webBrowser1.Url = new Uri(@"http://google.com");
        }


void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
   {
       foreach (HtmlElement he in webBrowser1.Document.All.GetElementsByName("q"))
       {
           he.SetAttribute("value", "eeee");
       }
   }


What I have tried:

i have tried this above code it able to pop up chrome, but not able to change the html value.
Posted
Comments
Richard Deeming 4-Jun-20 5:52am    
REPOST
This is the same question you posted yesterday:
C# HTML element change value in website[^]

If you want to update your question to add more information, click the green "Improve question" link and update your question. Do not post your update as a new question.
F-ES Sitecore 4-Jun-20 6:45am    
It'll be "popping up" in chrome due to Process.Start, but that is unrelated to your webbrowser control so changing things via that won't have any affect on the version that "popped up" via Process.Start. Also it is unlikely there will be any elements with the name "q" that exist for you to change.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900