Give something like this a shot. There are some details missing in your post, so I had to make some assumptions.
There are two approaches below:
1) Use getElementByID and see if the InnerText returns
2) Use getElementByID and then iterate the paragraph tags.
Public Sub test()
Dim ie As Object
Dim vCompanyAddress As Variant
Dim i As Long: i = 0
Dim Elements As Object
Dim Element As Object
ReDim vCompanyAddress(1000) ' Not sure how big this array should be
Set ie = CreateObject("InternetExplorer.Application")
With ie
.navigate ("https://www.xxxx.com/")
While .Busy Or .ReadyState <> 4: DoEvents: Wend
'You can try two things, this:
vCompanyAddress(i) = .document.getElementById("header-left-box").innerText
'Or you can try this, get the element then create an element
'collection with all paragraphs tags
Set Elements = .document.getElementById("header-left-box").getElementsByTagName("p")
For Each Element In Elements
vCompanyAddress(i) = Element.innerText
i = i + 1
Next
End With
End Sub
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…