Access/VBA Library

scrapeElements Method

Returns the content of all elements on the current webpage matching the given CSS-selector.

See also: https://www.w3schools.com/cssref/css_selectors.asp

Syntax

clsIE.scrapeElements( cssSelector )
Parameters
Name Type Description
clsIE   The name of an object of type clsIE
cssSelector String Required. Pattern to select the elements on the current webpage.
Return value

Collection : Each entry contains the content of a selected element.

clsIEtag:clsIE
Example
Dim IE As New clsIE
Dim content As Collection
Dim index As Long

IE.location = "https://www.w3schools.com"
Set content = IE.scrapeElements("p.w3-xlarge")
For index = 1 To content.count
    Debug.Print content(index)
Next index
' Immediate results:
'The language for building web pages
'The language for styling web pages
'The language for styling web pages
'The language for programming web pages