curl / Mailing Lists / curl-users / Single Mail

curl-users

Re: How do I read the version on this web page?

From: Ray Satiro <raysatiro_at_yahoo.com>
Date: Fri, 4 Jan 2019 03:40:59 -0500

On 1/2/2019 10:22 PM, ToddAndMargo wrote:
> On this following web page:
>
> https://www.eset.com/us/business/endpoint-security/windows-security/download
>
>
> Firefox clearly shows me the version (7.0.2091.0).
>
> Problem: I can't figure out how to download that part
> of the web page that include the version.
>
> What am I doing wrong?  How is Firefox seeing the 7.0.2091.0?

Javascript. I would ask them if they support a programmatic way to
obtain the version so you can safely automate it. A web debugger shows
that it retrieves the version information json from this URL (which of
course is subject to change since it's not documented):

https://www.eset.com/us/business/endpoint-security/windows-security/download/?type=13554&tx_esetdownloads_ajax%5Bproduct%5D=82&tx_esetdownloads_ajax%5Bbeta%5D=0&tx_esetdownloads_ajax%5Bpage_id%5D=931&tx_esetdownloads_ajax%5Bplugin_id%5D=1456376

From that data you can use jq to get the version information associated
with the latest ees_nt64.msi (which I assume is the one that would be
the most popular and one you want) that's in .files .installer. Doing
that depends on filtering for another URL which is subject to change:

https://download.eset.com/com/eset/apps/business/ees/windows/latest/ees_nt64.msi

perl:

$json_url =
"https://www.eset.com/us/business/endpoint-security/windows-security/download/?type=13554&tx_esetdownloads_ajax%5Bproduct%5D=82&tx_esetdownloads_ajax%5Bbeta%5D=0&tx_esetdownloads_ajax%5Bpage_id%5D=931&tx_esetdownloads_ajax%5Bplugin_id%5D=1456376";

$msi_url =
"https://download.eset.com/com/eset/apps/business/ees/windows/latest/ees_nt64.msi";

$tag = 'curl --fail --location -sS --proto =https "' . $json_url . '" | ' .
       'jq --raw-output ".files | .installer | first(.[] |select(.url |
endswith(\\"' . $msi_url . '\\"))) | .full_version"';

$tag = `$tag`;
!$? || die; # this only covers jq failure, there's no pipefail in cmd shell.

$tag =~ s/\r?\n$//;

print "tag $tag.\n";

It might be more reliable to download the msi instead and use
--time-cond / -z to download it when newer, see
https://curl.haxx.se/docs/manpage.html#-z

-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-01-04