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.
 

Some videos you may like

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,230
Office Version
  1. 365
Platform
  1. Windows
Why are you using toString?

Have you tried innertext?
 

John_w

MrExcel MVP
Joined
Oct 15, 2007
Messages
6,622
Try adding, immediately before the 2nd With doc:
Code:
Set doc = IE.document
 

jamtay317

Well-known Member
Joined
Mar 6, 2013
Messages
769
thank you both, it ended up being
Code:
sDD = .getElementsByTagName("tr").Item(2).innerText
 

Watch MrExcel Video

Forum statistics

Threads
1,123,259
Messages
5,600,573
Members
414,389
Latest member
MarkElla

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
Top