My existing C# Winforms project earlier had the default WebBrowser control. As it fails to load modern websites, I have started using the Webview2 control.
The earlier WebBrowser control used to offer the Document property; which is missing from WebView2 control. How do we go about accessing the Document and subsequently DOM of the webview2 loaded page?
Currently I am getting compilation errors on the below line:
var _document = webBrowser.Document;
Error Message:
Error CS1061 WebView2 does not contain a definition for 'Document' and no accessible extension method 'Document' accepting a first argument of type 'WebView2' could be found (are you missing a using directive or an assembly reference?)
Any pointers on how to go about this would be helpful.