0

I currenly use a webview to load a site into a native xamarin.ios app.

public override void ViewDidLoad()
    {
        base.ViewDidLoad();
        addressTxt.Text = "192.0.0.0";
        var request = new NSMutableUrlRequest(new 
        NSUrl("http://test/"));
        request.HttpMethod = "GET";
        webview.LoadRequest(request);
    }

This loads the site correctly into the webview. But i need to grab a hidden field value from the page for use within the app. Is there any i can do this?

I've seen a few examples, but nothing for xamarin.ios.

Thanks

the_tr00per
  • 439
  • 7
  • 23

1 Answers1

1

You need to evaluate JavaScript returning needed field to get value from page in UIWebView.

string result = _webViewInstance.EvaluateJavascript(yourJavaScriptCode);

also you can see this answer WKWebView evaluate JavaScript return value

Community
  • 1
  • 1
Kuchur Andrei
  • 117
  • 11