Xamarin: How to get HTML from page in WebView?
12,363
You can just use javascript webView.EvaluateJavascript ("document.body.innerHTML")
Author by
lp6m
Updated on June 11, 2022Comments
-
lp6m about 2 years
Xamarin: How to get HTML from page in WebView?
I develop Xamarin App for iOS and I am using WebView.
Just to get HTML of page, I use the following code.
WebClient wc = new WebClient(); using (Stream st = wc.OpenRead("http://study-csharp.blogspot.jp/")){ using (StreamReader sr = new StreamReader(st, Encoding.UTF8)){ string html = sr.ReadToEnd(); Console.Write(html); } }
However, I want HTML data after the user has logged in to the site in the webview.
I can't find the method to get HTML in UIWebView.
Thanks in advance.
-
lp6m about 9 yearsThis work perfectly! Thanks!!
-
SANDEEP over 7 yearsis tihs working for Xamarin Fomrs..
-
Artur Shamsutdinov over 7 years@SANDEEP see stackoverflow.com/questions/40859287/…
-
Wizard over 4 yearsand how to get HTML string in C# code?
-
Rodney Willis almost 4 yearsThis answer doesn't work anymore in Xamarin Forms 4.6+