I am developing simple app and i want lode and display the web page on image tap but i don’t want to display header div content that contains menu, logo image.
for that am able to call and display the web page using web browser control on
my C# code id
private void image_Tap(object sender, GestureEventArgs e)
{
webBrowser1.Navigate(new Uri("http://www.my-url.com", UriKind.Absolute));
}
that works fine.
and now how can i remove header tag data(content in b/w < header >< /header > divs).
thanks in advance
Web browser control simply loads the HTML document you pass to it. There is no direct way to manipulate this HTML if the document is not hosted on your own servers. A very raw approach would be to parse the HTML document and then do a Search/Replace on
<header>...</header>with<!--<header>..</header>-->You can use WebBrowser.SaveToString method to save the HTML document source as a string. For HTML parsing in C#, I would suggest HTML Agility Pack. Also have a look at What is the best way to parse html in C#? and Parsing HTML String.