请问如何实现如何使用网际快车的jc_all.htm文件在程序中得到网页中的链接 ( 积分: 50 )

  • 主题发起人 主题发起人 liminyes
  • 开始时间 开始时间
L

liminyes

Unregistered / Unconfirmed
GUEST, unregistred user!
站里原来的答案好像不能得到准确结果,不知哪们朋友知道方法啊,多谢!
 
站里原来的答案好像不能得到准确结果,不知哪们朋友知道方法啊,多谢!
 
google找一下,我也是用googl找的,回家把带码给你用C++写的
 
...难怪,我用google是找的delphi版的,晚上请把c++版的发上来给我看看啊,对了兄弟,能不能帮忙改成delphi用的啊,我C++没学过:(
谢谢
 
我提看delphi改成C++的 最好自己动手吧,我也是自己想的,网上只是参考
 
帮忙把你手上的资料发上来一下让我先看看行不
 
等了几天都没来,另外转个帖,看楼主需要不

http://www.delphibbs.com/delphibbs/dispq.asp?LID=409047
标题是: 怎么做flashget那样的链接列表
 
好像不行啊
 
不会吧,用WebBrower的方式是可以的阿,下面是我刚写的例子,参考
unit Main;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls, SHDocVw, StdCtrls, ComCtrls, mshtml;

type
TForm1 = class(TForm)
Button1: TButton;
WebBrowser1: TWebBrowser;
ListView1: TListView;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure WebBrowser1DocumentComplete(Sender: TObject; const pDisp: IDispatch;
var URL: OleVariant);
private
FFinished: Boolean;
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
doc: IHTMLDocument2;
all: IHTMLElementCollection;
len, i: integer;
item: OleVariant;
listitem: TListItem;
begin
if not FFinished then
ShowMessage('网页正在下载中……')
else begin
doc := WebBrowser1.Document as IHTMLDocument2;
all := doc.Get_links; //doc.Links亦可
len := all.length;
for i := 0 to len - 1 do begin
item := all.item(i, varempty);
listitem := ListView1.Items.Add;
listitem.Caption := item.href;
listitem.SubItems.Add(item.innertext);
end;
end;
end;


procedure TForm1.FormCreate(Sender: TObject);
begin
WebBrowser1.Navigate('http://www.163.com');
FFinished := False;
end;

procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject; const pDisp: IDispatch; var URL: OleVariant);
begin
FFinished := True;
end;

end.


窗体文件
object Form1: TForm1
Left = 192
Top = 107
Width = 696
Height = 480
BorderIcons = [biSystemMenu, biMinimize]
Caption = '获取网页所有链接示例'
Color = clBtnFace
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = '宋体'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 12
object Button1: TButton
Left = 576
Top = 212
Width = 93
Height = 25
Caption = '获取连接'
TabOrder = 0
OnClick = Button1Click
end
object WebBrowser1: TWebBrowser
Left = 0
Top = 0
Width = 688
Height = 201
Align = alTop
TabOrder = 1
OnDocumentComplete = WebBrowser1DocumentComplete
ControlData = {
4C0000001B470000C61400000000000000000000000000000000000000000000
000000004C000000000000000000000001000000E0D057007335CF11AE690800
2B2E126208000000000000004C0000000114020000000000C000000000000046
8000000000000000000000000000000000000000000000000000000000000000
00000000000000000100000000000000000000000000000000000000}
end
object ListView1: TListView
Left = 0
Top = 244
Width = 688
Height = 209
Align = alBottom
Columns = <
item
Caption = '连接地址'
Width = 350
end
item
Caption = '说明'
Width = 250
end>
TabOrder = 2
ViewStyle = vsReport
end
end
 
to chenybin
有没有得到IE的?谢谢
 
获得IE的没有,我的想法是需要在IE上面做个按钮,象FlashGet那样的,原理应该差不多,反正都是分析网页代码,所以问题就在于怎么读取IE的代码了,其实jc_all的哪个东西可能还是可以调出来的,这种事情别人不会象我这么多管闲事的,我已经努力了,楼主自己搞定吧

to goddy
啥时候从家里回来阿,好久了
 
多人接受答案了。
 
后退
顶部