Sign in to follow this  
Followers 0
gcue

downloading a file that changes its name

4 posts in this topic

#1 ·  Posted (edited)

I am trying to download an update of bloomberg - problem is that the file name changes every month. "Update the Bloomberg Application"

Here is where i get the error

$aResult = StringRegExp($sHTML, "(?i)(?s)(?U:<p><strong>Bloomberg Application.+</p>)", 3)

id really appreciate any help anyone can give me! thanks in advance

here is the script

; Get Software Update page source
            $sHTML = _INetGetSource("http://www.bloomberg.com/professional/software_support/")
            If @error Then
                BloombergUpdater_error()
                Return
            EndIf

            MsgBox(0, "", $sHTML)

            ;Parse Bloomberg Application paragraph section
            $aResult = StringRegExp($sHTML, "(?i)(?s)(?U:<p><strong>Bloomberg Application.+</p>)", 3)
            If @error Then
                BloombergUpdater_error()
                Return
            EndIf
            $sBAParagraph = $aResult[0]


            ;Parse version information
            $aResult = StringRegExp($sBAParagraph, "(?i)\((.+)\)", 3)
            If @error Then
                BloombergUpdater_error()
                Return
            EndIf
            $sVersionInfo = $aResult[0]

            ;Parse download hyperlink
            $aResult = StringRegExp($sBAParagraph, '(?i)(?U)<a.+"(.+)"', 3)
            If @error Then
                BloombergUpdater_error()
                Return
            EndIf
            $sDLLink = $aResult[0]

            $iSize = InetGetSize($sDLLink)
Edited by gcue

Share this post


Link to post
Share on other sites



How much does the name change?

#include <array.au3>
#include <INet.au3>

            ; Get Software Update page source
            $sHTML = _INetGetSource("http://www.bloomberg.com/professional/software_support/")
            If @error Then

                Else
            EndIf

;~             MsgBox(0, "", $sHTML)

            ;Parse Bloomberg Application exe name
            $aResult = Stringregexp($sHTML, "http://bdn-ak.bloomberg.com/software/trv/upgr\d\d\d\d\d\d.exe", 2)
            If @error Then
                    msgbox (0, '' , @ERROR)
                Else
            EndIf
;~             _ArrayDisplay ($aResult)


inetget ($aResult[0] , @scriptdir & "\BloombergUpgrade.exe")

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

upgr*.exe would always fit i think.

the * ends up being the date its released.

thannks for your help!

ill try it out.

Share this post


Link to post
Share on other sites

works like a charm!!!

many many many thanks!!!!

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