Article View: pl.comp.lang.delphi
Article #345525Re: Delphi Webbrowser JavaScript
From: konsul41
Date: Wed, 11 Jan 2017 09:08
Date: Wed, 11 Jan 2017 09:08
110 lines
3896 bytes
3896 bytes
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ść?
---
Ta wiadomość została sprawdzona na obecność wirusów przez oprogramowanie antywirusowe Avast.
https://www.avast.com/antivirus
Technical Details
Message-ID:
<o54sme$h16$1@portraits.wsisiz.edu.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin3!goblin.stu.neva.ru!wsisiz.edu.pl!.POSTED.jue163.internetdsl.tpnet.pl!not-for-mailReferences:
<o527lv$cnt$1@portraits.wsisiz.edu.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin3!goblin.stu.neva.ru!wsisiz.edu.pl!.POSTED.jue163.internetdsl.tpnet.pl!not-for-mail From: "konsul41@wp.pl" <konsul41@wp.pl> Newsgroups: pl.comp.lang.delphi Subject: Re: Delphi Webbrowser JavaScript Date: Wed, 11 Jan 2017 10:08:32 +0100 Organization: http://www.wit.edu.pl Message-ID: <o54sme$h16$1@portraits.wsisiz.edu.pl> References: <o527lv$cnt$1@portraits.wsisiz.edu.pl> Mime-Version: 1.0 Injection-Date: Wed, 11 Jan 2017 09:08:30 +0000 (UTC) Injection-Info: portraits.wsisiz.edu.pl; posting-host="jue163.internetdsl.tpnet.pl:95.48.160.163"; logging-data="17446"; mail-complaints-to="abuse@wsisiz.edu.pl" User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 In-Reply-To: <o527lv$cnt$1@portraits.wsisiz.edu.pl> X-Antivirus: avast! (VPS 170110-1, 2017-01-10), Outbound message X-Antivirus-Status: Clean Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit