社区
网络及通讯开发
帖子详情
如何取得TWebBrowser上显示的网页的内容(不是网页源码,是网页上显示的文字)
nhyoung
2003-12-15 09:28:26
如何取得TWebBrowser上显示的网页的内容(不是网页源码,是网页上显示的文字)
...全文
95
10
打赏
收藏
如何取得TWebBrowser上显示的网页的内容(不是网页源码,是网页上显示的文字)
如何取得TWebBrowser上显示的网页的内容(不是网页源码,是网页上显示的文字)
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
10 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
nhyoung
2003-12-16
打赏
举报
回复
终于成功了!!多谢各位的帮忙!!!
void __fastcall TForm1::Button2Click(TObject *Sender)
{
BSTR title,source,content;
IHTMLDocument2 *document;
IHTMLElement *body;
(void *)document=CppWebBrowser1->Document;
document->get_body(&body);
document->get_title(&title);
body->get_outerText(&content);//取文本
// body->get_outerText(&)
Memo1->Text = content;
Edit1->Text = title;
}
叶子哟
2003-12-15
打赏
举报
回复
将BSTR转成AnsiString
storejyjs
2003-12-15
打赏
举报
回复
搜索一下以前的帖子,有许多个这种帖子
nhyoung
2003-12-15
打赏
举报
回复
对不起,又要问你!!这样
void __fastcall TForm1::Button2Click(TObject *Sender)
{
IHTMLDocument2 *document;
IHTMLElement *body;
(void *)document=CppWebBrowser1->Document;
document->get_body(&body);
BSTR content;
Memo1->Text = body->get_outerText(&content);//取文本
}
怎么只得“0”,没有取到啊,多谢!!
MEFULEU
2003-12-15
打赏
举报
回复
#include "SHDocVw_OCX.h"
#include <ExDispID.h>
#include "mshtml.h"
nhyoung
2003-12-15
打赏
举报
回复
对不起,我是刚学的,报错!!!
[C++ Error] Unit1.cpp(36): E2451 Undefined symbol 'IHTMLDocument2'
[C++ Error] Unit1.cpp(36): E2451 Undefined symbol 'document'
怎样办??
nhyoung
2003-12-15
打赏
举报
回复
多谢!可以的话,下五马上给分你
叶子哟
2003-12-15
打赏
举报
回复
IHTMLDocument2 *document;
IHTMLElement *body;
(void *)document=CppWebBrowser1->Document;
document->get_body(&body);
BSTR source,content;
body->get_outerHTML(&source);//取源程序
body->get_outerText(&content);//取文本
小笨象
2003-12-15
打赏
举报
回复
AnsiString(content);
就行了。
nhyoung
2003-12-15
打赏
举报
回复
怎样将BSTR转成AnsiString?拜托了!!!!
Delphi T
Web
Browser
本文详细介绍了 Delphi 中
Web
Browser
控件的各种属性、事件、方法及其使用技巧,包括如何控制
网页
加载、编辑模式设置、获取
网页
内容
及执行
网页
交互操作等。
华为荣耀recovery1.0
源码
链接: https://pan.quark.cn/s/a4b39357ea24 This directory contains a script ('makefsdata') to create C code suitable for httpd for given html pages (or other files) in a directory. There is also a plain C console application doing the same and extended a bit. Usage: htmlgen [targetdir] [-s] [-i]s targetdir: relative or absolute path to files to convert switch -s: toggle processing of subdirectories (default is on) switch -e: exclude HTTP header from file (header is created at runtime, default is on) switch -11: include HTTP 1.1 header (1.0 is default) if targetdir not specified, makefsdata will attempt to process files in subdirectory 'fs'.
光纤耦合器Matlab模拟.rar
光纤耦合器Matlab模拟.rar
网络及通讯开发
1,317
社区成员
8,874
社区内容
发帖
与我相关
我的任务
网络及通讯开发
C++ Builder 网络及通讯开发
复制链接
扫一扫
分享
社区描述
C++ Builder 网络及通讯开发
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章