I would like to retrieve results of Google search by Lazarus component TIdHTTP
, part of Indy.
I have seen this already. I can use CUrl to retrieve some results.
To do the same with TIdHTTP
, I have this :
queries:= TStringList.Create;
engine := 'http://www.google.com/search';
queries[0] := '?q=inurl:"foo"';
for i := 0 to queries.Count-1 do
begin
Memo1.Lines.Add('Asking for : ' + engine + queries[i]);
try
IdHTTP1.Get(engine+queries[i], response);
response.Position := 0;
Memo2.Lines.LoadFromStream(response);
finally
response.Free;
end;
end;
The IdHTTP
component's UserAgent
property is set to Firefox/12.0
(property browser > request > UserAgent > Firefox/12.0 with upper case F). However, that is giving me this error :
"Project project1 raised exception class EIdIOHandlerPropInvalid with the message 'IOHandler value is not valid'"
In file 'xyz ... IdHTTP.pas at line 939
raise EIdIOHandlerPropInvalid.Create(RSIOHandlerPropInvalid)
That was translated from German to English.
Googling the error leads to this question on SO. I realize that it has something to do with an http request being redirected to an https server. However, the answer to the other SO question is targeted on windows platform.
Question:
Could anyone please help me to tell me how to implement the same on Linux platform where the mentioned DLLs (libeay32.dll, ssleay32.dll) do not exist?
I have tried out the solution without caring for the DLLs - it results in a new error :
"Project project1 has raised exception class EIdOSSLCouldNotLoadSSLLibrary with the message 'Couldn't load SSL library'"
Note:
core/openssl 1.0.2.k-1 is installed. Linux is Manjaro (64-bit).