html文件用safari打开方式,如何使用openURL()读取在safari中打开的html文件 - c#代码 - 源码查...
問題
I am trying to open a page using
UIApplication.sharedApplication.openURL(url)
I do few clicks and then it opens another page. I want to read that html body/content of newly opened page. How do I go about it?
Is there any other way to open a browser (in built browser and not UIWebview) and do the same?
Edit :
Say, I am opening google
UIApplication.sharedApplication.openURL(new NSUrl("www.google.com"));
I search for apple and it shows the results. Now I click wikipedia and it opens a page ie., wikipedia page for apple.
How do i get the html content of that wikipedia apple page? is there a way?
解決方法
In iOS you won't be able to do that.
I could do this easily using a WebView inside a ViewController.
public override void ViewDidLoad()
{
base.ViewDidLoad();
webView.LoadRequest(new NSUrlRequest(new NSUrl("https://xamarin.com")));
webView.LoadFinished += (sender, e) =>
{
if (webView.IsLoading)
{
return;
}
var html = webView.EvaluateJavascript("document.documentElement.outerHTML");
};
}
總結
以上是生活随笔為你收集整理的html文件用safari打开方式,如何使用openURL()读取在safari中打开的html文件 - c#代码 - 源码查...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 利用计算机提高数学课堂教学,计算机技术在
- 下一篇: c# char unsigned_dll