Closed celtic-coder closed 11 months ago
Hi Liam,
Thank you for your report. It helped me to fix the wrong documentation of getHttps.
The function getHttps actually expects a location
as parameter instead of an URL. A location is an URL without https://
or http://
at the beginning.
I have corrected the wrong documentation in gethttps.s7i and gethttp.s7i
So, if you use getHttps("example.com")
instead of getHttps("https://example.com/")
, it will probably work. At least on my computer I succeed with:
$ include "seed7_05.s7i";
include "gethttps.s7i";
const proc: main is func
local
var string: Page_HTML is "";
begin
Page_HTML := getHttps("example.com");
if Page_HTML <> "" then
writeln(Page_HTML);
end if;
end func;
This writes the HTML of example.com
. Now I could create a DOM from the HTML string with readHtml.
When I implemented getHttp it seemed ridiculous to specify http
twice (in the function name and in the URL). So I decided that http://
must be omitted from the URL. I just forgot to document my approach and I also kept url
as parameter name. Now the parameter is named location
and the documentation contains an explanation and some examples.
Hi Thomas (@ThomasMertes),
Thanks for making the documentation changes! I can confirm that the HTML for example.com
now downloads as expected.
Kind Regards, Liam
Hi Thomas (@ThomasMertes),
The following Seed7 code is not producing any output:
However, the following cURL command works correctly:
Although, this is the cURL from https://curl.se/. The native cURL in Windows 10 fails with an error that the installed libcurl version doesn't support the "--compressed" option.
When I compile the program with the following options:
s7c -tf -p
, when run it gives the following output:This would seem to indicate that the program is going through the correct steps, starting and ending with the getHttps. Also, the profile output gives:
Given that cURL is working correctly, it might further indicate a possible problem with the getHttps function on my Windows 10 laptop. Are there any other steps where I could continue to troubleshoot this problem?
Kind Regards, Liam