Kuinka allaolevan sivuston jatko käynnistetään linkistä ohjelmallisesti. Kyseessä Delphi 2009
virhe: Method 'getAttribute' not supported by automation object
var ie,inputCollection,inputElement,LogoElement,SpanElement,ChildElement:OleVariant;
i,j:integer;
s:string;
ie := CreateOleObject('InternetExplorer.Application');
ie.Visible := true;
SpanElement:=ie.document.getElementsByTagName('span');
for I:=0 to SpanElement.length-1 do
begin
ChildElement:=SpanElement.item(i);
If ChildElement.getAttribute('class')='otp.katso.1' Then
begin
LogoElement:=ChildElement.getElementsByTagName('a');
s:=LogoElement.getAttribute('href',2).value;
end;
end;https://asiointi.vero.fi/verotili/
Lähdekoodi linkistä:
<div class="loginlogo">
<div class="loginlogoimage">
<span class="otp.katso.1">
<span class="authlogo">
<a href="/ubitp/authn/31eb33a8-2f55-4981-adcd-9bb73bc6cd73/select?entityID=urn%3Auuid%3Ab1976050-8963-623c-dd81-aa5fd1752569&locale=fi&method=otp.katso.1">
<img src="/ubitp/resource/logo_katso-otp.gif?locale=fi" alt="Katso OTP"/>
</a>
</span>
</span>
</div>
<div class="loginlogotext">
<a href="/ubitp/authn/31eb33a8-2f55-4981-adcd-9bb73bc6cd73/select?entityID=urn%3Auuid%3Ab1976050-8963-623c-dd81-aa5fd1752569&locale=fi&method=otp.katso.1">Katso OTP</a>
</div>
</div>Mod. lisäsi kooditagit!
Aihe on jo aika vanha, joten et voi enää vastata siihen.