Merhaba; Bing arama motorunda bir sonraki sayfaya geçme işlemi için butona click yaptırmak istiyorum fakat butonun id si olmadığı için click işlemi gerçekleşmiyor acaba bu konuda ne yapabilirim?
Memo1.Lines.Add(IEApp.Document.getElementsByTagName('a')); ve
ButonName := (IEApp.Document.getElementsByClassName('sb_pagN')); memoya aldığımda ([object]) olarak geliyor acaba nerede hata yapıyorum
if (VarIsEmpty(IEApp)) then
begin
IEApp := CreateOleObject('InternetExplorer.Application');
ShowWindow(IEApp.HWND, SW_SHOWMAXIMIZED);
IEApp.Visible := True;
end;
IEApp.Navigate('https://www.bing.com/search?q=' + 'Arabam');
while (IEApp.Busy) - 1 do
begin
Sleep(1000);
Application.ProcessMessages;
for I := 0 to IEApp.Document.Links.length - 1 do
begin
Memo1.Lines.Add(IEApp.Document.getElementsByTagName('a'));
ButonName := (IEApp.Document.getElementsByClassName('sb_pagN'));
if ButonName = 'sb_pagN' then
begin
Bilgi.Caption := 'İşlem Devam Ediyor Lütfen Bekleyin...';
end;
end;
end;
şu konuda mrmarman hocamın neFis bir örneği var arabam com sayfasında sayfa sayısını alıp sayfa sayfa geziyor açıklamalı . örneğide mecut indirebilrsin.
Mrmarman hocama emeğinle bu güzel örneği paylaştığı için teşekkür ediyorum.
Teşekkür ederim sayın mrmarman hocamın paylaşımını daha önce ve bugün tekrar inceledim maalesef ki işimi çözmüyor...
Bir kaç gündür ve dün gece boyunca SimaWB hocamın verdiği (links := WebBrowser1.OleObject.Document.getElementsByTagName("a");) fikir konusunda araştırma yaptım fakat hiç bir şekilde sonuç alamadım memoya
[object HTMLCollection] veya [object] olarak geliyor...
procedure TForm3.SpeedButton1Click(Sender: TObject);
var
i: integer;
deneme: variant;
begin
deneme := Form2.WebBrowser1.OleObject.Document.getElementsByTagName('a');
for I := 0 to deneme.length - 1 do
begin
Memo1.Lines.Add(deneme);
end;
end;
var
Doc: IHTMLDocument2;
Links: IHTMLElementCollection;
aLink: IHTMLElement;
i: integer;
begin
Doc := WebBrowser1.Document as IHTMLDocument2;
Links := Doc.Links;
for i := 0 to Links.Length-1 do
begin
aLink := Links.Item(i, EmptyParam) as IHTMLElement;
if aLink.ClassName = 'sb_pagN' then
aLink.Click;
end;
procedure TForm3.SpeedButton1Click(Sender: TObject);
var
I: Integer;
Sayfa: String;
IEApp: OleVariant;
Doc: IHTMLDocument2;
Links: IHTMLElementCollection;
aLink: IHTMLElement;
begin
try
if (VarIsEmpty(IEApp)) then
begin
IEApp := CreateOleObject('InternetExplorer.Application');
ShowWindow(IEApp.HWND, SW_SHOWMAXIMIZED);
IEApp.Visible := True;
end;
IEApp.Navigate('https://www.bing.com/search?q= ' + 'Telefon');
while (IEApp.Busy) - 1 do
begin
Sleep(1000);
Application.ProcessMessages;
Doc := IEApp.Document as IHTMLDocument2;
Links := Doc.Links;
for I := 0 to Cardinal(IEApp.Document.Links.length) - 1 do
begin
Link := IEApp.Document.Links.Item(I);
Sayfa := Trim(IEApp.Document.Links.Item(I).InnerText);
İşi bilen yardım eder, az bilen akıl verir, bilmeyen eleştirir, yapamayan ise çamur atar...