2

I have posted a thread before and it is solved in perfect way at this link Scrape using XMLHTTP throws error at specific class name And here is the working code

Sub GetProfileInfo()
Const URL$ = "https://www.zillow.com/detroit-mi/real-estate-agent-reviews/?page="
Dim Http As New XMLHTTP60, Html As New HTMLDocument
Dim post As HTMLDivElement, R&, P&

For p = 1 To 3 'put here the highest number you wanna traverse
    With Http
        .Open "GET", URL & p, False
        .send
        Html.body.innerHTML = .responseText
    End With

    For Each post In Html.getElementsByClassName("ldb-contact-summary")
        With post.querySelectorAll(".ldb-contact-name a")
            If .Length Then R = R + 1: Cells(R, 1) = .item(0).innerText
        End With

        With post.getElementsByClassName("ldb-phone-number")
            If .Length Then Cells(R, 2) = .item(0).innerText
        End With
    Next post
Next p
End Sub

But it seems that it works only on windows. How can I get it work on MAC?

braX
  • 11,506
  • 5
  • 20
  • 33
YasserKhalil
  • 9,138
  • 7
  • 36
  • 95
  • Seems like `HttpRequests` are broken on Office for Mac. Maybe https://stackoverflow.com/a/48600055/9439330 works.Or try a shell with [cURL](https://stackoverflow.com/questions/38906626/curl-to-return-http-status-code-along-with-the-response) – ComputerVersteher Oct 20 '18 at 07:32
  • Duplicate: https://stackoverflow.com/questions/18282443/winhttprequest-on-mac-osx-excel-2011-vba – ashleedawg Oct 20 '18 at 10:48
  • @ashleedawg, your possible dupe is 5years old, a long time and it doesn't cover the shell just `QueryTables`. Maybe similar, but a newer look at it will take care of new problems (as ms doesn't care to much on Office on Mac OS). – ComputerVersteher Oct 20 '18 at 11:11
  • @ComputerVersteher - alright. I wasn't sure, hence why it was a comment, not a flag. – ashleedawg Oct 20 '18 at 13:18
  • @ashleedawg, keep on cleaning SO up. I tend to give attention to poor and dupe questions, what I should avoid (but I like to help :( ) – ComputerVersteher Oct 20 '18 at 13:24
  • [VBA-Web](https://github.com/VBA-tools/VBA-Web) looks intersting for Webrequest on Mac. – ComputerVersteher Oct 20 '18 at 21:42
  • Did you ever get a good solution? I suspect it will involve AppleScript. – Tuntable Jan 28 '21 at 02:51

0 Answers0