获取网页源码delphi
㈠ 哪位大侠通晓delphi中使用正则表达式提取网页源文件的过程,我要发送信息,必须先要解析网页源码
我使用的是Perlreg,你可以从网上下载后载入Delphi中。
网上有这个的正则列子,你不妨看一下,其实正则用的时候再学就可以了,很简单。
㈡ delphi WebBrowser1 怎么获取框架中的框架的网页代码
这是写的一个程序中的部分代码,供参考:
framedoc:=WebBrowser1.DocumentasIHTMLDocument2;
ifframedoc.frames.length>0then//判断是否带有框架
begin
frame_dispatch:=framedoc.frames.item(0);//第1个框架
doc:=(frame_dispatchasIHTMLWindow2).document;
end;
㈢ delphi主流浏览器窗口句柄获取源码
获取所有句柄,源码如下:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Memo1: TMemo;
btn_listwindow: TButton;
procere btn_listwindowClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
function EnumWindowsProc(AhWnd:LongInt;AForm:TForm1):boolean;stdcall;
implementation
{$R *.dfm}
function EnumWindowsProc(AhWnd:LongInt;AForm:TForm1):boolean;
var
lpszClassName,lpszWindowText:array[0..254] of char;
begin
GetWindowText(AhWnd,lpszWindowText,254);
GetClassName(AhWnd,lpszClassName,254);
Aform.memo1.lines.add(StrPas(lpszWindowText));
Aform.memo1.lines.add(StrPas(lpszClassName));
Aform.memo1.lines.add( '-------------------- ');
Result:=True;
end;
procere TForm1.btn_listwindowClick(Sender: TObject);
begin
EnumWindows(@EnumWindowsProc,LongInt(self));
end;
end.
F9,运行,看看结果。最好是F7单步跟踪调试一下,看看回调函数是怎么被调用的。
㈣ DELPHI提取网页源码部分内容问题
不是这样取的,按照元素取
s := WebBrowser1.OleObject.document.getElementByID('span1').innerText;
㈤ delphi中如何直接得到WebBrowser的HTML源码
如果你想用webbrowser控件来获取
生成aspx的源代码,基本上不太可能。
当你用http协议访问服务器时,
服务器只会给你经过解析后生成的代码,
而不太可能给你源代码,除非这个文件不能被正常解析
㈥ 提交数据之后如何取网页源码
先调试输出,找到网页上你要的数据,然后新建一个变量,用取出中间文本来取出你要的数据。
获取网页源代码中的具体步骤如下:
1、首先我们在浏览器里随意打开一张网页查看其源代码。
2、然后我们点击浏览器上的查看。
3、在选项中选择后面位置的查看源代码。
4、然后我们可以看到该网页中的源代码。
5、其中的源代码也可以点击访问。
6、点击访问的源代码的显示的如下图,即可看到源代码所显示的数据。
7、重新测试程序,从网页源码编辑框的看反馈结果.
㈦ delphi HTTP协议取网页源码
以下方法就是DELPHI的
先
uses UrlMon; //urlmon包含urldownloadtofile函数
使用如下方法下载
UrlDownloadToFile(nil, PChar('http://www..com/'), PChar('index.htm'), 0, nil);
㈧ 怎样用delphi 获取网页html源代码(网页需登录)
不要用IDHTTP控件
用EmbeddedWB控件就行了
如果没有的话去<a href="http://www.delphinbox.com" target="_blank">www.delphinbox.com</a>下载
IDHTTP是按内存流的方式读网页代码,东西多了效率就低
EmbeddedWB是以MSHTML接口读网页代码,可以把读到的代码批量送出