Jump to content

downloading a file that changes its name


gcue
 Share

Recommended Posts

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
Link to comment
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")

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...