Avatar of SaTaX
SaTaX

asked on 

IdHttp, Get Source from a https:// site!

Hi,
I am searching very long for a solution to get a source from a HTTPS:// page!

This is how I did the work:
I added an idhttp component, then an IdSSLIOHandlerSocketOpenSSL component and I insterted IdSSLIOHandlerSocketOpenSSL in Idhttp as IOHandler.
Then I added "IdSSLOpenSSLHeaders.Load;" in form.create.
And finally I added the 3 DLL's in the application folder. (libssl32.dll,ssleay32.dll,libeay32.dll).
If I run the program, it gives some weird errors like Address 0000X0000.
The source code:
procedure TForm2.FormCreate(Sender: TObject);
begin
IdSSLOpenSSLHeaders.Load;
end;
 
procedure TForm2.SpeedButton1Click(Sender: TObject);
begin
try
memo1.Text :=  idhttp1.Get('https://weblogin.runescape.com/login.ws');
finally
idhttp1.Free;
idssliohandlersocketopenssl1.Free;
end;
end;

Open in new window

DelphiPascal

Avatar of undefined
Last Comment
SaTaX
Avatar of Geert G
Geert G
Flag of Belgium image

where is the create of your objects ?

i can see a free of 2 objects but no create ...

idhttp1 := TIdHttp.Create ...
idssliohandlersocketopenssl1 := Tidssliohandlersocketopenssl.Create ...

and if you put them on the form, don't use free
otherwise you will get errors the second time you use the procedure
Avatar of SaTaX
SaTaX

ASKER

What do you mean...
I don't use create , I use visual - I click Indy Clients - Idhttp - Add to form.
Avatar of Geert G
Geert G
Flag of Belgium image

ah ok, but why do you free them ?

memo1.Text :=  idhttp1.Get('https://weblogin.runescape.com/login.ws');
finally
idhttp1.Free;
idssliohandlersocketopenssl1.Free;
end;

the second time nothing will work and you will get access violation when using idHttp1 or
idssliohandlersocketopenssl1
Avatar of SaTaX
SaTaX

ASKER

even if I change it to
memo1.Text :=  idhttp1.Get('https://weblogin.runescape.com/login.ws');
except
end;
end;
Avatar of SaTaX
SaTaX

ASKER

I have an other questions, I will increase points if someone answers this:

I have a website, and I need to get the source of the result.
If I navigate with the webbrowser to:
http://www.w2.hidemyass.com/index.php?q=aHR0cDovL2dvb2dsZS5jb20= 
You're result will be Google.
But if I use this link with idhttp1.get(), I get another result, how to get to google?
Do I need idhttp1.post () ? or, please give me an example!
Avatar of Geert G
Geert G
Flag of Belgium image

get to google ?

just use www.google.com
why make it so difficult ?
ASKER CERTIFIED SOLUTION
Avatar of SaTaX
SaTaX

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Delphi
Delphi

Delphi is the most powerful Object Pascal IDE and component library for cross-platform Native App Development with flexible Cloud services and broad IoT connectivity. It provides powerful VCL controls for Windows 10 and enables FMX development for Windows, Mac and Mobile. Delphi is your choice for ultrafast Enterprise Strong Development™. Look for increased memory for large projects, extended multi-monitor support, improved Object Inspector and much more. Delphi is 5x faster for development and deployment across multiple desktop, mobile, cloud and database platforms including 32-bit and 64-bit Windows 10.

60K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo