none
Trouble scrolling a split screen of a webpage RRS feed

  • Question

  • I've written a script in vba to scrape some items from a webpage. By default, there are 4/5 items visible when I open that page. However, the webpage displays it's rest of the items when it is made to scroll downward. If it were not for split screen, I could have handled it using "parentwindow.scrollby". As I do not have any idea how to scroll any partial screen of a webpage, I get stuck. Any help on this will be highly appreciated.

    Here is what I've written so far:

    Sub Get_Result()
        Const URL As String = "https://www.quintoandar.com.br/alugar/imovel/sao-paulo-sp-brasil/1-vagas/de-20-a-75-m2/de-500-a-4400-reais/apartamento"
        Dim IE As New InternetExplorer, html As HTMLDocument
        Dim storage As Object, posts As Object, post As Object
    
        With IE
            .Visible = True
            .navigate URL
            Do Until .readyState = READYSTATE_COMPLETE: Loop
            Set html = .document
        End With
    
        For i = 1 To 5
            Set storage = html.getElementsByClassName("sc-jqCOkK gkztbk")
            html.parentWindow.scrollBy 0, 99999  ''this doesn't work at all
            Application.Wait Now + TimeValue("00:00:003")
        Next i
    
        For Each posts In storage
                row = row + 1: Cells(row + 1, 1) = posts.querySelector("[id='app.components.HouseCard.rentLine']").innerText
        Next posts
        IE.Quit
    End Sub


    Tuesday, January 16, 2018 9:02 PM