[英]ExecuteScript - get the complete source website
How to use ExecuteScript to get the complete page source - something like browser does with如何使用 ExecuteScript 获取完整的页面源代码 - 类似于浏览器所做的
view-source: https//..any..web..page
If I call ExecuteScript wbBrowser.ExecuteScript('document.documentElement.outerHTML')
I only get what is displayed on the page.如果我调用 ExecuteScript
wbBrowser.ExecuteScript('document.documentElement.outerHTML')
我只会得到页面上显示的内容。 However, there are web pages that display data in a table and currently only display a portion of the records (eg 1-10 out of 1000).但是,有些网页在表格中显示数据,目前只显示部分记录(例如,1000 条记录中的 1-10 条)。 By calling
wbBrowser.ExecuteScript('document.documentElement.outerHTML')
I only get the current 1-10, but the browser will display the complete data using view-source: https//****)
.通过调用
wbBrowser.ExecuteScript('document.documentElement.outerHTML')
我只得到当前的 1-10,但浏览器将使用view-source: https//****)
显示完整的数据。
Unfortunately, for data protection reasons, I can't show the source of the page.不幸的是,出于数据保护的原因,我无法显示页面的来源。 I hope I have described it clearly, sorry for the English
我希望我已经描述清楚了,对不起英文
view-source
shows you the HTML source of an HTML document as it was sent from the server to the browser. view-source
显示 HTML 文档从服务器发送到浏览器时的 HTML 源代码。 Script like document.documentElement.outerHTML
will give you an HTML serialization of the current state of the DOM which may not be the same as the original HTML source of the HTML document.像
document.documentElement.outerHTML
这样的脚本会给你一个 DOM 当前状态的 HTML 序列化,它可能与 HTML 文档的原始 HTML 源不同。 There's no way in script (AFAIK) that can give you the original HTML source instead of the current state of the DOM.脚本 (AFAIK) 无法为您提供原始 HTML 源代码,而不是 DOM 的当前状态。
In WebView2 if you want to see the actual content sent from the server you can use the CoreWebView2.WebResourceResponseReceived
event to see the HTML source or the source of any other resource obtained from the network.在 WebView2 中,如果您想查看从服务器发送的实际内容,可以使用
CoreWebView2.WebResourceResponseReceived
事件查看 HTML 源代码或从网络获取的任何其他资源的源代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.