XanzyX Posted April 2, 2014 Share Posted April 2, 2014 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 Link to comment Share on other sites More sharing options...
Palestinian Posted April 2, 2014 Share Posted April 2, 2014 How about this link? > "http://www.avg.com/us-en/download-file-dm-triisi.tpl-stdfull", does it change every time? Link to comment Share on other sites More sharing options...
Solution DW1 Posted April 2, 2014 Solution Share Posted April 2, 2014 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) XanzyX 1 AutoIt3 Online Help Link to comment Share on other sites More sharing options...
XanzyX Posted April 2, 2014 Author Share Posted April 2, 2014 The link stays the same, always. What comes from the link is different Link to comment Share on other sites More sharing options...
Palestinian Posted April 2, 2014 Share Posted April 2, 2014 (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 April 2, 2014 by Palestinian Link to comment Share on other sites More sharing options...
XanzyX Posted April 2, 2014 Author Share Posted April 2, 2014 Thanx guys. I had to go home to see if it worked and it did. Link to comment Share on other sites More sharing options...
XanzyX Posted April 5, 2014 Author Share Posted April 5, 2014 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 Link to comment Share on other sites More sharing options...
XanzyX Posted April 5, 2014 Author Share Posted April 5, 2014 I Think it would be best to post a new thread Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now