1

I am signing up for classes for my university; however, classes have filled up and I need to keep refreshing to check when/if classes have opened up. I have a specific page that I want to refresh that has the details of whether the classes I am interested in are open/closed. I cannot simply use a Chrome extension such as Page Monitor, since, if I hit the browser refresh button, I end up being directed to the main logged in page of the University (I'm not logged out, simply on a different part of site than where I need to check for changes).

How can I have a script/macro that will:

1) Refresh the page.

2) Navigate to the page I need to check. (About 3 clicks, one of the clicks is a radio button, if that makes a difference).

3) Check for the changes I am looking for, if change exists, then send e-mail or create desktop notification.

4) Repeat after x amount of time... i.e. 5 mins.

I have been Googling extensively for a solution, but seems like no solution exists as of yet. I would really appreciate some ideas/solution. Thanks!

0

I have been trying to do something along the same lines. The best I have been able to come up with is a VBA script that runs from Excel. It can open the page, log in (if necessary) and simulate button clicks. The content of the page can be scanned for changes and an email can be sent to you if changes are present. The only problem is you have to have a computer on which you can leave Excel open

The macro consists of 3 macros 1) runs macro on open 2) sets time interval 3) executes script

Sub Auto_Open()
    MacroScheduler
End Sub

Sub MacroScheduler()
    'This macro sets the script to Run every minute
    runontime = Now + TimeValue("00:01:00") 'Change time intervals here
    Application.OnTime runontime, "MacroScheduler"
    OnlineChecker runontime
End Sub

Sub OnlineChecker(ByRef timetorun2)
    Dim NewEntry As Boolean
    NewEntry = False
    Dim ThisDoc As Object
    Set ThisDoc = Workbooks(ThisWorkbook.Name).Worksheets("Sheet1")
    Dim ie As Object
    Set ie = CreateObject("InternetExplorer.Application")
    Dim IEobj As Variant
    Dim doc As Variant


    With ie
        .navigate "[YOUR URL]" 'Insert your URL here
        .Visible = False
    End With

        Do While ie.Busy: DoEvents: Loop
        Do While ie.ReadyState  4: DoEvents: Loop

    Set el = doc.getElementsByTagName("Input") 'this can be changed based on element type
    For Each IEobj In el
            Select Case IEobj.ID
            Case Is = "[Name of Element]" ' Insert name of HTML Element here
                    IEobj.Click
            End Select
    Next

    Do While ie.Busy: DoEvents: Loop
        Do While ie.ReadyState  4: DoEvents: Loop



    If Not ThisDoc.Range("A1") = "" Then
            If ThisDoc.Range("A1") = doc.body.innerText Then
                Exit Sub
            Else
                ThisDoc.Range("A1") = doc.body.innerText
                NewEntry = True
            End If
    Else
        ThisDoc.Range("A1") = doc.body.innerText
    End If

        If NewEntry = True Then
            NewEntry = False
    'This is meant to work with gmail accounts

    Dim iMsg As Object
        Dim iConf As Object
        Dim strbody As String
        Dim Flds As Variant

        Set iMsg = CreateObject("CDO.Message")
        Set iConf = CreateObject("CDO.Configuration")

    iConf.Load -1
    Set Flds = iConf.Fields
        With Flds
            .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
            .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
            .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "[Insert your email address here]"
            .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "[Insert your password]"
            .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
            .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
            .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
            .Update
        End With

        strbody = "Class Posted"


        With iMsg
            Set .Configuration = iConf
            .To = "[Insert your email address]"
            .CC = ""
            .BCC = ""
            .From = "[Insert your email address]"
            .Subject = "Class Posted"
            .TextBody = strbody
            .send
        End With

        End If
        Application.StatusBar = "Done - Next Run @ " & timetorun2
            ie.Quit: Set ie = Nothing

End Sub
0

Use Trimgle Web Monitor extension for modern browser

With Trimgle u can monitor all web page and json like REST API, You can send the collected information to a Webhook page automatically

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.