need help with extracting information from page source

jamtay317

Well-known Member
Joined
Mar 6, 2013
Messages
769
this is my code so far, I am trying to extract daily updates from a server backup.

Code:
Sub GetBaracudaBakups()
Dim email As String, password As String
email = [Email_Name]
password = [Password_name]
' nacigate to website
'=================================================================
    Dim IE As New InternetExplorer
    
    URL = "https://login.barracudanetworks.com/auth/login/"
    With IE
        .navigate URL
        Do
         DoEvents
        Loop Until IE.readyState = READYSTATE_COMPLETE


        Dim doc As HTMLDocument: Set doc = IE.document
        .Visible = True
    End With
      ' insert emial and password to login
     '=================================================================
    With doc
        .getElementById("username").innerText = email
        .getElementById("password").innerText = password
        .getElementById("submit").Click
   End With
   ' loop
   '===================================================
   Application.Wait (Now + TimeValue("0:00:10"))
   Dim site As Worksheet: Set site = Sheet1
   lr = site.Cells(Rows.Count, 3).End(xlUp).Row
   For x = 1 To lr
        URL = site.Cells(x, 3).Value
        With IE
            .navigate URL
        End With
        Application.Wait (Now + TimeValue("0:00:10"))
        '=============================================
        Dim sDD As String
'        Dim html_col As HTMLElementCollection
        With doc
        sDD = .getElementsByTagName("span").Item(0).toString
        End With
         
          
        Debug.Print sDD
        
        
    Next x
End Sub

here is the source

screenshot.jpg


when I debug.print it returns

[object HTMLCollection]

please help with this one.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Why are you using toString?

Have you tried innertext?
 
Upvote 0

Forum statistics

Threads
1,213,543
Messages
6,114,237
Members
448,555
Latest member
RobertJones1986

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top