How to get inner html source from WebView in Xamarin Form - C#

后端 未结 2 857
孤独总比滥情好
孤独总比滥情好 2020-12-21 12:39

I am using WebView to load my authentication web page. After the successful authentication, I need to get some values from html source content. can anyone helm to read the s

2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-21 12:52

    Here is my code:

     private async Task GetHtml()
            {
                return await LoginWebViewItem.EvaluateJavaScriptAsync("document.body.innerHTML");
            }
    

    Then I call this from my method:

    string AllHtml = await GetHtml();
    

提交回复
热议问题