简体   繁体   English

如何阅读页面源代码TWebBrowser Firemonkey

[英]How to read page source TWebBrowser Firemonkey

How can I read source of the open page in TWebBrowser in firemonkey (RadStudio XE7 - Firemonkey for Android) 如何在firemonkey中的TWebBrowser中读取打开页面的源代码(RadStudio XE7-Firemonkey for Android)

In VCL I simply used WebBrowser1.document but in firemonkey it has an error VCL我只使用了WebBrowser1.document但是在firemonkey中,它有一个错误

TWebBrowser does not contain a member named document TWebBrowser不包含名为document的成员

How can I fix that? 我该如何解决?

The sad answer is that you can't access the source code of a webpage directly from the TWebBrowser. 令人遗憾的答案是,您不能直接从TWebBrowser访问网页的源代码。 You can't access it because the TWebBrowser in FireMonkey is cross-platform and that means it must work on all platforms. 您无法访问它,因为FireMonkey中的TWebBrowser是跨平台的,这意味着它必须在所有平台上都可以使用。 Android and iOS does not support and allow this, which means the Windows Desktop version of TWebBrowser can't allow this either. Android和iOS不支持并且不允许这样做,这意味着Windows桌面版本的TWebBrowser也不允许这样做。

You will have to use a different component to do this, probably a third party component. 您将不得不使用其他组件来执行此操作,可能是第三方组件。

I am not sure if this will help you or not, but here is a link to something that might help: http://firemonkeylessons.blogspot.tw/2015/01/get-htmljson-from-twebbrowser.html 我不确定这是否对您有帮助,但是以下是可能有所帮助的链接: http : //firemonkeylessons.blogspot.tw/2015/01/get-htmljson-from-twebbrowser.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM