How to linkify a specific word in C# webbrowser on OnDocumentComplete event. I want to linkfy all the words say 'hemant' to hemant appears in the document in my c# browser. How to just add the anchor ta开发者_JAVA百科g around any specific word using onDocumentComplete event?
You need to grab the HtmlDocument from the browser control and iterate the DOM and modify it.
Examples on using HtmlDocument can be found at MSDN.
For iterating all elements check out the All
property. For each HtmlElement check innerText or innerHTML for your word, and change accordingly to wrap it with an anchor.
精彩评论