question

markuswolf6704Wolf-4025 avatar image
0 Votes"
markuswolf6704Wolf-4025 asked DanielZhang-MSFT edited

Webview2 Javascript Frame text

Hi,

I would like to read some text from a website with webview2.

In the devtools console I have to change the javascript context:
108226-image.png



Then it is possible to use
document.documentElement.innerText

How it is possible to change the javascript context in webview2 to get the text?
Thanks.

dotnet-csharpwindows-forms
image.png (18.6 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @markuswolf6704Wolf-4025,
You can try to use WebView2.ExecuteScriptAsync(String) method.
Please check if this link is helpful to you.
Best Regards,
Daniel Zhang


0 Votes 0 ·

0 Answers