michael 28 has asked for the wisdom of the Perl Monks concerning the following question:

Hi Guys,

Until last week I was able to download the web page content of:
https://www.reuters.com/finance/stocks/analyst/AMZN

With
use LWP::Simple qw(get); $res_1 = get "https://reuters.com/finance/stocks/analyst/AMZN";
Now it doesn't succeed
I will be thankful to you , if you can help me with how to download this web page with Perl

Best Regards,
Michael

Replies are listed 'Best First'.
Re: Perl Get from https
by Your Mother (Archbishop) on Aug 20, 2019 at 13:15 UTC

    Works fine for me. Your problem report leaves some room for improvement. :P

    perl -MLWP::Simple -E 'say get("https://reuters.com/finance/stocks/ana +lyst/AMZN")' <!doctype html><html lang="en"><head> <title>Amazon.com Inc (AMZN.O) Analysts | Reuters.com</title> # et cetera…
      Thank you very much for the quick reply, I updated the Perl version and now it works OK. Thanks Michael
Re: Perl Get from https
by Fletch (Bishop) on Aug 20, 2019 at 13:16 UTC

    As you can clearly see by the detailed error message you helpfully provided the problem is that your vreemflitzer has worn off the mandatory 23 micron coating of unobtanium. Recalibrate the neutron flow polarity through the APS relay on deck 19 and then jiggle the handle.

    Actually in your defense, LWP::Simple isn't giving you much of an error to work with. In cases like this something like curl -v can be helpful; that shows that you need to use "www.reuters.com" instead. Once you do that it'll then redirect you to use "AMZN.0" instead.

    Update: Nevermind me, I forgot to use curl -L to make it follow the redirects. Your original non-www-not-ending-.0 URL works fine for me as well. ENOCAFFEINE (Insufficient brain function in user)

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.