Sign in to follow this  
Followers 0
XanzyX

Using InetGet to dowload an unknown file name from the same link

8 posts in this topic

I have been trying to download a file using InetGet from the link below. The problem is that I never know the exact filename to be downloaded and that file name changes with each version. I would like to retain the original file name from the site.

http://www.avg.com/us-en/download-premium-security-thank-you

Share this post


Link to post
Share on other sites



I'm sure a regex guru can come along and make a nicer, proper regex for this, but this is grabbing the links for me.

This should grab the recommended downloads for premium security (trial and paid)

#include <Inet.au3>
#include <Array.au3>

Local $sURL = 'http://www.avg.com/us-en/download.prd-isi'
Local $sSource = _INetGetSource($sURL)
Local $aRegEx = StringRegExp($sSource, 'a href="(.*\.exe)"(?:.*\R){0,5}.*Recommended', 3)
_ArrayDisplay($aRegEx)
1 person likes this

Share this post


Link to post
Share on other sites

The link stays the same, always. What comes from the link is different

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

You can try what DW1 suggested, you can also try this:

#RequireAdmin
#include <InetConstants.au3>

InetGet("http://www.avg.com/us-en/download-file-dm-triisi.tpl-stdfull","D:\setup.exe")

It worked for me.

You don't actually need the #include <IE.au3>, I accidentally forgot it there.

Edited by Palestinian

Share this post


Link to post
Share on other sites

Thanx guys.  I had to go home to see if it worked and it did.

Share this post


Link to post
Share on other sites

I really hate being a jerk but I saw your examples and implemented them successfully.  Thank you again.

Part 2 of my application entailed downloading all of the virus updates for all Windows versions from this link ----> http://free.avg.com/us-en/download-update#tba1 

The links are not always the same label and the file names are not always the same file name.  I have tried adjusting your examples for this part to no avail. Can you please help me with this as well?

Thank You

Share this post


Link to post
Share on other sites

I Think it would be best to post a new thread

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0