From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED.3d73Ybk3C5U4I2t8lv+lAQ.user.gioia.aioe.org!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Simple parse from https website Date: Thu, 2 Apr 2020 16:42:32 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <7dc6d888-696c-4936-b678-66e1c8198449@googlegroups.com> NNTP-Posting-Host: 3d73Ybk3C5U4I2t8lv+lAQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:58282 Date: 2020-04-02T16:42:32+02:00 List-Id: On 2020-04-02 15:58, Rego, P. wrote: > I am trying to make a simple parser for an https website push, so trying to follow from the example from http://rosettacode.org/wiki/HTTP#Ada, just changing the address from a website. > > So I tried > > with Ada.Text_IO; use Ada.Text_IO; > > with AWS.Client; > with AWS.Response; > > procedure Main_Other is > begin > Put_Line (AWS.Response.Message_Body > (AWS.Client.Get > (URL => "https://google.com"))); > end Main_Other; > > But I got an exception > raised PROGRAM_ERROR : aws-client.adb:398 finalize/adjust raised exception > [2020-04-02 10:41:20] process exited with status 1, elapsed time: 00.80s > > So, any thoughts on how to fix that? This is certainly an induced error. You get some exception which propagates on and upon finalization of an AWS object (AWS Client?) causes another exception inside its Finalize. I suggest you to report it to AdaCore, as this is surely a bug. As for the original error, like another poster guessed, you seem try to establish an insecure connection (HTTP) to a secure server (HTTPS), get bounced and then, see above. You need to configure OpenSSL or GNUTLS for you AWS client before connecting. I cannot help with details because I don't use AWS. There should be some samples of secure HTTP connection using an AWS client. > I'd like to parse the current status of some tables in a website, similar of making something like that in Python > > import pandas as pd > def retrieve_json(json_url): > return pd.read_json(json_url) Hmm, google.com content does not look like JSON, far from. Though they may have REST API in JSON format, is that you are trying to do? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de