Próbuję przeszukiwać Dokument tak:
Doc := WebBrowser1.Document as IHTMLDocument2;
allLinks := Doc.all;
Memo1.Lines.Clear;
for i :=0 to allLinks.length-1 do
begin
firstLink := allLinks.Item(i,'') as IHTMLElement;
if firstLink.className='PageWrapper' then
begin
allLinks:=firstLink.Get_all AS IHTMLElementCollection;
break;
end;
end;
for i :=0 to allLinks.length-1 do
begin
//try
firstLink := allLinks.Item(i,'') as IHTMLElement;
//listall(firstLink.Get_all AS IHTMLElementCollection);
if firstLink.className='ContentWrapper' then
begin
allLinks:=firstLink.Get_all AS IHTMLElementCollection;
break;
end;
end;
for i :=0 to allLinks.length-1 do
begin
try
firstLink := allLinks.Item(i,'') as IHTMLElement;
if firstLink.ID='FAST_MANAGER_PLACEHOLDER' then
begin
listall(firstLink.Get_all AS IHTMLElementCollection);
url1:=firstLink.toString;
//allLinks:=firstLink.Get_all AS IHTMLElementCollection;
break;
end;
except
end;
end;
Wynik listowania:
1-pętla
[object HTMLDivElement] title ---- className --PageWrapper-- ID ----
tagname --DIV--
2-pętla
[object HTMLDivElement] title ---- className --ContentWrapper-- ID ----
tagname --DIV--
<div class="ContentWrapper">
<noscript><div class="NoScript">Javascript must be enabled to
use this site.</div></noscript><script
type="text/javascript">FWDC.setVerLast('1._.fkgudDs1XuqrlNK9nTmwotpnlFs1',
'HTML: _ [Page,443036130] @ 2017-01-11 09:52:28.6655')
</script><script>FWDC.loadManager();</script>
<div id="FAST_MANAGER_PLACEHOLDER"></div>
<div class="clearer"></div>
</div>
---- listall
length 0
---- listall
[object HTMLDivElement] title ---- className ---- ID
--FAST_MANAGER_PLACEHOLDER-- tagname --DIV-- type
<div id="FAST_MANAGER_PLACEHOLDER"></div>
W ostatniej pętli Dostaję FAST_MANAGER_PLACEHOLDER a powinienem dostać
id="MANAGER_CONTAINER__0"
lub
class="ManagerContainer ManagerContainer_Fast_TAP NonLoggedOn
HasNavigation SidebarPinned"
To widzę w InternetExplorer gdy nacisnę "Sprawdź element" z menu.
<div tabindex="100" title="" class="ManagerContainer
ManagerContainer_Fast_TAP NonLoggedOn HasNavigation SidebarPinned"
id="MANAGER_CONTAINER__0">
Co to za technika ukrywania i jak to obejść?