With this code I can go to this webpage and capture the first 10 events. The problem is that there are 30+ events and I need to capture them all. When you are scrolling manually with the mouse something triggers the retrieval of the next 10 events. How do I do this programmatically in VBA until I get to the bottom?
Sub DownloadFile()
Dim WinHttpReq As Object
Dim oStream As Object
Dim myURL As String
Dim LocalFilePath As String
myURL = "https://www.meetup.com/cflfreethought/events/"
LocalFilePath = "C:UsersBrooksDesktopHTML_download.txt"
Set WinHttpReq = CreateObject("Microsoft.XMLHTTP")
WinHttpReq.Open "GET", myURL, False, "", "" '("username", "password")
WinHttpReq.send
If WinHttpReq.status = 200 Then
Set oStream = CreateObject("ADODB.Stream")
oStream.Open
oStream.Type = 1
oStream.Write WinHttpReq.responseBody
oStream.SaveToFile LocalFilePath, 2 ' 1 = no overwrite, 2 = overwrite
oStream.Close
End If
End Sub
New contributor
Brooks is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.