comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Simple parse from https website
Date: Thu, 2 Apr 2020 16:42:32 +0200
Date: 2020-04-02T16:42:32+02:00	[thread overview]
Message-ID: <r64tkm$1ne8$1@gioia.aioe.org> (raw)
In-Reply-To: 7dc6d888-696c-4936-b678-66e1c8198449@googlegroups.com

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

  parent reply	other threads:[~2020-04-02 14:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-02 13:58 Simple parse from https website Rego, P.
2020-04-02 14:24 ` Egil H H
2020-04-02 14:44   ` Rego, P.
2020-04-03  9:35     ` Björn Lundin
2020-04-03 12:04       ` Rego, P.
2020-04-02 14:42 ` Dmitry A. Kazakov [this message]
2020-04-02 14:48   ` Rego, P.
2020-04-02 17:16     ` Dmitry A. Kazakov
2020-04-02 18:27       ` Rego, P.
2020-04-02 19:05         ` Dmitry A. Kazakov
2020-04-02 19:34           ` Rego, P.
2020-04-03  5:19             ` Jere
2020-04-03 12:13               ` Rego, P.
2020-04-03 12:30                 ` Rego, P.
2020-04-03 12:49                   ` Dmitry A. Kazakov
2020-04-03  6:47             ` Dmitry A. Kazakov
2020-04-03 12:42               ` Rego, P.
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox